forked from KINGMJ/my-webpack-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.common.js
More file actions
43 lines (41 loc) · 1.33 KB
/
Copy pathwebpack.common.js
File metadata and controls
43 lines (41 loc) · 1.33 KB
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
34
35
36
37
38
39
40
41
42
43
const CleanWebpackPlugin = require('clean-webpack-plugin');
const config = {
//多页面应用入口配置
entry: {
home: './app/home/home.js',
about: './app/about/about.js',
contact: './app/contact/contact.js'
},
module: {
rules: [
{test: /\.(png|svg|jpg|gif)$/, use: ['file-loader']},
{test: /\.(woff|woff2|eot|ttf|otf)$/, use: ['file-loader']},
{
test: /\.m?js$/,
exclude:
/(node_modules|bower_components)/,
use:
{
loader: 'babel-loader',
options:
{
presets: ['env'],
plugins:
['transform-runtime', 'transform-remove-strict-mode', 'transform-object-rest-spread']
}
}
}
]
},
resolve: {
alias: {
'@': path.resolve(__dirname, './app')
}
},
plugins: [
//清空dist文件夹
new CleanWebpackPlugin(['dist'])
],
}
;
module.exports = config;