-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
45 lines (40 loc) · 1.07 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
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var path = require('path');
var dir_build = path.resolve(__dirname, 'build');
var dir_html = path.resolve(__dirname, 'html');
var dir_js = path.resolve(__dirname, 'app');
module.exports = {
entry: {
app: path.resolve(dir_js, 'App.jsx')
},
output: {
path: dir_build,
filename: 'bundle.js',
publicPath: 'http://localhost:8080/build/'
},
devServer: {
contentBase: dir_build,
publicPath: 'http://localhost:8080/build/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['react', 'es2015']
}
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader'}
]
},
plugins: [
// Avoid publishing files when compilation fails
new webpack.NoErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.IgnorePlugin(new RegExp("^(fs|ipc)$"))
]
}