-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
41 lines (40 loc) · 1.09 KB
/
webpack.config.js
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
const HtmlWebpackPlugin = require('html-webpack-plugin')
const cleanWebpackPlugin = require('clean-webpack-plugin')
module.exports = {
entry: {
a: './src/js/a.js',
b: './src/js/b.js',
c: './src/js/c.js'
},
output: {
path: __dirname + '/dist',
filename: './js/[name].bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
title: 'Output Management',
chunks: ['a'],
template: './src/index.html',
filename: 'index.html'
}),
new cleanWebpackPlugin(["dist"]),
],
module: {
rules: [
{
test: /\.js$/,
use: ["babel-loader"],
// 不检查node_modules下的js文件
exclude: "/node_modules/"
},
// {
// test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/,
// loader: "url-loader?limit=8192"
// },
// {
// test: /\.png$/,
// loader: "file-loader?name=imgs/[name]-[hash].[ext]"
// }
]
}
}