-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
47 lines (41 loc) · 1.15 KB
/
Copy pathwebpack.config.js
File metadata and controls
47 lines (41 loc) · 1.15 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
44
45
46
47
var path = require('path')
module.exports = {
entry: './app/userlabel.jsx',
output: {
// path:"./dist",
filename: 'bundle.js'
},
resolve: {
modulesDirectories: ['node_modules', path.join(__dirname, '../node_modules')],
extensions: ['', '.web.js', '.js', '.json','.jsx'],
},
module: {
loaders:[
{
test: /\.jsx?$/, // 用正则来匹配文件路径,这段意思是匹配 js 或者 jsx
loader: 'babel',
exclude:/node_modules/,
query: {
presets: ['react', 'es2015'],
cacheDirectory: true,
plugins: [
["import", {
"libraryName": "antd",
"style": true, // or 'css'
}]
]
}
},
{
test: /\.css$/, loader: 'style-loader!css-loader'
},
{
test: /\.less$/, loader: 'style-loader!css-loader!less-loader'
},
{
test: /\.(jpg|png)$/,
loader: 'url?limit=25000'
}
],
},
};