-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
57 lines (56 loc) · 1.41 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
55
56
57
var webpack = require('webpack');
var path = require('path');
var node_modules = path.resolve(__dirname, 'node_modules');
module.exports = {
//插件项
plugins: [new webpack.optimize.MinChunkSizePlugin({
compress: {
warnings: false
}
})],
//页面入口文件配置
entry: {
index: './index.js'
},
//入口文件输出配置
output: {
path: path.join(__dirname, './dist'),
filename: '[name].js'
},
// entry: {
// index: './src/index.js'
// },
// output: { //umd
// path: path.resolve(__dirname, 'umd'),
// filename: 'Autocomplete.js', // 注意我们使用了变量
// library: "leoReact",
// libraryTarget: "umd"
// },
// externals: [{
// 'react': {
// root: 'React',
// umd: 'react'
// }
// }, {
// 'react-dom': {
// root: 'ReactDOM',
// umd: 'react-dom'
// }
// }],
module: {
//加载器配置
loaders: [{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader'
}, {
test: /\.css$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader!autoprefixer-loader'
}]
},
//其它解决方案配置
resolve: {
extensions: ['', '.js', '.json', '.scss', '.jsx']
}
};