-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.dev.js
81 lines (79 loc) · 1.99 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
const webpack = require('webpack');
const path = require('path');
const postLoaders = [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'istanbul-instrumenter'
}
];
module.exports = {
entry: [
'script-loader!jquery/dist/jquery.min.js', 'script-loader!bootstrap-sass/assets/javascripts/bootstrap.min.js', './client/react/react-app.jsx'
],
externals: {
jquery: 'jQuery'
},
plugins: [new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development')
}
})],
output: {
path: __dirname,
filename: './public/bundle.js'
},
resolve: {
alias: {
Index: path.join(__dirname, 'client/react/components/Index.jsx'),
Header: path.join(__dirname, 'client/react/components/Header.jsx'),
Login: path.join(__dirname, 'client/react/components/Login.jsx'),
Profile: path.join(__dirname, 'client/react/components/Profile.jsx')
},
modules: [
__dirname, 'node_modules', path.join(__dirname, 'client/react'),
path.join(__dirname, 'client/react/components'),
path.join(__dirname, 'client/redux')
]
},
module: {
rules: [
{ // For loading Markdown
test: /\.(txt|md)$/,
loader: 'raw-loader'
},
// Loader for JSON, used in some tests
{
test: /\.json$/,
loader: 'json-loader'
}, {
test: /\.jsx?$/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
query: {
'babelrc': false,
'presets': [
[
'es2015', {
'modules': false
}
],
['react'],
['stage-0']
],
'plugins': [],
'env': {
'test': {
'plugins': ['istanbul']
}
}
}
}
]
}
]
},
devtool: 'eval-source-map'
};