forked from AllenFang/react-bootstrap-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.example.config.js
46 lines (42 loc) · 1.16 KB
/
webpack.example.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
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
app: './examples/js/app.js',
vendors: ['webpack-dev-server/client?http://localhost:3004', 'webpack/hot/only-dev-server']
},
devtool: 'eval',
output: {
path: path.join(__dirname, 'examples'),
filename: '[name].bundle.js'
},
serverConfig: {
port: '3004',// server port
publicPath: '/',// js path
contentBase: 'examples/'//web root path
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'react-bootstrap-table': path.resolve(__dirname, './src')
}
},
module: {
loaders: [
{
test: /\.jsx$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel']
}, {
test: /\.js$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel']
}, {test: /\.less$/, loader: 'style-loader!css-loader!less-loader'}, // use ! to chain loaders
{test: /\.css$/, loader: 'style-loader!css-loader'}]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
};