mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-31 14:16:42 +02:00
mermaidAPI should target node
This commit is contained in:
31
webpack.config.base.js
Normal file
31
webpack.config.base.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import path from 'path'
|
||||
import nodeExternals from 'webpack-node-externals'
|
||||
|
||||
export const webConfig = () => {
|
||||
return {
|
||||
target: 'web',
|
||||
entry: {
|
||||
mermaid: './src/mermaid.js'
|
||||
},
|
||||
externals: 'fs',
|
||||
output: {
|
||||
path: path.join(__dirname, './dist/'),
|
||||
filename: '[name].js'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const nodeConfig = () => {
|
||||
return {
|
||||
target: 'node',
|
||||
entry: {
|
||||
mermaidAPI: './src/mermaidAPI.js'
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
output: {
|
||||
path: path.join(__dirname, './dist/'),
|
||||
filename: '[name].js',
|
||||
libraryTarget: 'commonjs2'
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user