-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
69 lines (59 loc) · 1.45 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
58
59
60
61
62
63
64
65
66
67
68
69
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var environment = require('./environment.js');
module.exports = {
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'./' + environment.APP + '/src/index.jsx' // Your appʼs entry point
],
output: {
path: './' + environment.APP + '/build',
publicPath: '/',
filename: 'bundle.js'
},
devtool: 'source-map',
module: {
preLoaders: [
{
test: /\.(js|jsx)$/,
loader: 'eslint-loader'
}
],
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel']
},
{
test: /\.css$/,
loader: 'style!css!postcss!'
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader?limit=8192'
}
]
},
postcss: [autoprefixer],
resolve: {
extensions: ['', '.js', '.jsx'],
modulesDirectories: ['node_modules', 'components', 'node_modules/bootstrap/dist/css']
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(environment.NODE_ENV)
}),
new webpack.HotModuleReplacementPlugin()
],
devServer: {
contentBase: './' + environment.APP,
host: '0.0.0.0',
port: 8080,
hot: true,
historyApiFallback: true,
colors: true,
stats: 'normal'
}
};