This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
91 lines (82 loc) · 1.89 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var styleLoaders = [
'style-loader',
'css-loader?sourceMap',
'autoprefixer-loader?browsers=last 2 version',
'sass-loader?sourceMap&outputStyle=expanded&' +
'includePaths[]=' +
(encodeURIComponent(path.resolve(process.cwd(), './node_modules')))
];
var cssLoaders = [
'style-loader',
'css-loader?sourceMap',
'autoprefixer-loader?browsers=last 2 version'
];
module.exports = {
devtool: 'eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./client/index.js'
],
output: {
path: __dirname + '/',
filename: 'app.js',
publicPath: '/'
},
resolve: {
extensions: ['', '.js', '.jsx', '.json', '.scss']
},
module: {
preLoaders: [{
test: /\.js$|\.test.js$/,
loaders: ['eslint'],
include: [
path.resolve(__dirname, 'client'),
path.resolve(__dirname, 'server')
]
}],
loaders: [
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.(png|jpg|svg)$/,
loader: "url-loader?limit=10000&mimetype=image/svg+xml"
},
{
test: /\.(woff|ttf|png|gif|jpg|jpeg)$/,
loader: 'file-loader'
},
{
test: /\.scss$/,
loader: styleLoaders.join('!')
},
{
test: /\.css$/,
loader: cssLoaders.join('!')
},
{
test: /\.jsx*$/,
exclude: [/node_modules/, /.+\.config.js/],
loader: 'babel',
query: {
presets: ['react-hmre']
}
}
]
},
plugins: [
new ProgressBarPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development'),
'CLIENT': JSON.stringify('true')
}
})
]
};