-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
53 lines (52 loc) · 1.55 KB
/
webpack.config.dev.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
var path = require('path');
var webpack = require('webpack');
require('babel-polyfill');
module.exports = {
// or devtool: 'eval' to debug issues with compiled output:
// devtool: 'source-map',
devtool: 'cheap-module-eval-source-map',
entry: {
bundle: [
// necessary for hot reloading with IE:
'babel-polyfill',
'eventsource-polyfill',
'react-hot-loader/patch',
// listen to code updates emitted by hot middleware:
'webpack-hot-middleware/client',
'./app/index',
'./css/base/_css-reset.scss',
'./app/containers/recordRedux/style.scss',
'./css/style.scss',
],
},
output: {
path: path.join(__dirname, 'static'),
filename: 'bundle.js',
publicPath: '/static/',
},
plugins: [
new webpack.ProvidePlugin({
React: 'react',
_: 'lodash',
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(`${process.env.NODE_ENV}`),
},
}),
],
module: {
loaders: [
{ test: /\.jsx?$/, loaders: ['babel-loader'], exclude: /node_modules/, include: __dirname },
{ test: /\.scss$/, loader: 'style!css?sourceMap!sass?sourceMap&sourceComments' },
{ test: /\.css$/, loaders: ['style-loader', 'css-loader?sourceMap'] },
{ test: /\.(woff2?|ttf|eot|svg|jpg|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader' },
],
},
resolve: {
modulesDirectories: ['app', 'src', 'node_modules'],
extensions: ['', '.js', '.jsx', '.json'],
},
};