mermaid/webpack.config.base.js

32 lines
606 B
JavaScript
Raw Normal View History

2017-04-16 21:38:48 +08:00
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'
}
}
}