Files
rl_2d_walker.js/webpack.config.js
T
2018-12-02 10:30:04 +08:00

45 lines
886 B
JavaScript

const path = require('path');
const webpack = require('webpack')
module.exports = {
entry: {
app: './src/index.js',
// lib: './src/vendor/index.js'
},
target: 'web',
devtool: 'dev-source-map',
output: {
path: path.join(__dirname),
filename: 'dist/[name].bundle.js',
// path:'/dist',
},
devServer: {
},
optimization: {
splitChunks: {
cacheGroups: {
lib: {
test: /jsbox2d/,
chunks: 'initial',
name: 'lib',
priority:20,
enforce:true
},
vendors: {
test: /[\\/]node_modules[\\/]/,
chunks: 'initial',
name: 'vendor',
priority: 10,
enforce: true,
}
}
}
},
plugins: [
new webpack.DefinePlugin({
// A flag to disable node imports, and enable window/dom usage
WEB: true
})
]
};