-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
75 lines (65 loc) · 1.67 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
70
71
72
73
74
75
/* eslint no-var: 0 */
// no-var: webpack configuration must be interpretable in non-es6 environments
var path = require('path');
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: 'eval',
entry: [
'webpack-hot-middleware/client', // for hot reload
'./client/index.js' // entry point for the client app
],
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
BROWSER: JSON.stringify(true),
NODE_ENV: JSON.stringify('development'),
BABEL_ENV: JSON.stringify('development/client')
}
})
],
sassLoader: {
data: '@import "theme/_theme.scss";',
includePaths: [path.resolve(__dirname, './client/css')]
},
resolve: {
alias: {
},
extensions: ['', '.scss', '.css', '.js', '.json'],
modulesDirectories: [
'node_modules',
path.resolve(__dirname, './node_modules')
]
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
include: __dirname
}, {
test: /\.scss$/,
loader: 'style!css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass',
include: [
path.resolve(__dirname, 'node_modules/react-toolbox'),
path.resolve(__dirname, 'common'),
path.resolve(__dirname, 'client')
]
}, {
test: /\.css$/,
loader: 'style!css?modules'
}, {
test: /\.png$/,
loader: 'url'
}
]
}
};