mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
32 lines
606 B
JavaScript
32 lines
606 B
JavaScript
|
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'
|
||
|
}
|
||
|
}
|
||
|
}
|