forked from AllenFang/react-bootstrap-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.example.config.js
57 lines (53 loc) · 1.85 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
47
48
49
50
51
52
53
54
55
56
57
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
basic: './examples/js/basic/demo.js',
column: './examples/js/column/demo.js',
columnFormat: './examples/js/column-format/demo.js',
sort: './examples/js/sort/demo.js',
pagination: './examples/js/pagination/demo.js',
selection: './examples/js/selection/demo.js',
manipulation: './examples/js/manipulation/demo.js',
cellEdit: './examples/js/cell-edit/demo.js',
complex: './examples/js/complex/demo.js',
style: './examples/js/style/demo.js',
advance: './examples/js/advance/demo.js',
tableDataSet: './examples/js/tableDataSet/demo.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': '../../../src/index.js'
}
},
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()
]
}