mirror of
https://github.com/wassname/rl_2d_walker.js.git
synced 2026-08-30 11:31:30 +08:00
45 lines
886 B
JavaScript
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
|
|
})
|
|
]
|
|
};
|