-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
33 lines (31 loc) · 779 Bytes
/
webpack.dev.js
File metadata and controls
33 lines (31 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const path = require('path');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
main: ["./main.js"]
},
output: {
path: path.resolve(__dirname, "bin"),
filename: "[name].[chunkhash].js"
},
devtool: 'source-map',
mode: 'development',
plugins: [
new CleanWebpackPlugin(['bin/*.*'], {root: __dirname}),
new HtmlWebpackPlugin({title: 'force-three'})
],
optimization: {
splitChunks: {
chunks: "all", name: "vendor", cacheGroups: {
vendor: {
test: /node_modules/,
chunks: 'initial',
name: 'vendor'
}
}
}
}
};