-
Notifications
You must be signed in to change notification settings - Fork 22
/
webpack.config.js
executable file
·49 lines (48 loc) · 1.01 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
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: [
'./dev/index.jsx',
],
devtool: 'source-map',
output: {
path: path.join(__dirname, 'dev'),
filename: 'bundle.js',
},
resolve: {
extensions: ['.js', '.jsx'],
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.json$/,
loader: 'json-loader',
},
{
test: /\.css$/,
include: __dirname,
loaders: ['style-loader', 'css-loader'],
},
],
},
plugins: [
/* eslint no-param-reassign:0 */
// this handles a bad require in cheerio for the package
new webpack.NormalModuleReplacementPlugin(/^\.\/package$/, (result) => {
if (/cheerio/.test(result.context)) {
result.request = './package.json';
}
}),
],
devServer: {
contentBase: './dev',
noInfo: true, // --no-info option
hot: true,
inline: true,
},
};