-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathwebpack.config.js
More file actions
43 lines (42 loc) · 848 Bytes
/
webpack.config.js
File metadata and controls
43 lines (42 loc) · 848 Bytes
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
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
index : './example/index.jsx'
},
//入口文件输出配置
output: {
path: path.join(__dirname, './dist/example'),
filename: '[name].js'
},
module: {
//加载器配置
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: [
'babel-loader'
]
}
]
},
//其它解决方案配置
resolve: {
alias: {
'react': path.join(__dirname, 'node_modules', 'react')
},
extensions: ['.js', '.jsx']
},
plugins: [
new HtmlWebpackPlugin({
template: './example/index.html'
})
],
devServer: {
stats: { chunks:false },
contentBase: './example',
hot: true
}
};