forked from youseries/ureport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
54 lines (54 loc) · 1.39 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
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Created by Jacky.Gao on 2018-04-15.
* Base on Webpack4
*/
const path=require('path');
module.exports={
mode:'development',
entry: {
designer:'./src/index.js',
searchform:'./src/form/index.js',
preview:'./src/preview.js'
},
output:{
path:path.resolve('../ureport2-console/src/main/resources/ureport-asserts/js'),
filename:'[name].bundle.js'
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
// 抽离第三方插件
test: /handsontable|codemirror|chart.js/,
chunks: 'initial',
name: 'common',
priority: 10
}
}
}
},
module:{
rules:[
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test:/\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }]
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 10000000
}
}
]
}
]
}
};