-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
68 lines (67 loc) · 1.71 KB
/
webpack.config.js
File metadata and controls
68 lines (67 loc) · 1.71 KB
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
// http://webpack.github.io/docs/configuration.html
// http://webpack.github.io/docs/webpack-dev-server.html
var webpack = require('webpack');
var CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: ['babel-polyfill', __dirname + '/src/app/index.js'],
output: {
path: __dirname + '/public/js',
publicPath: 'js/',
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
loaders: ['react-hot-loader', 'babel-loader'],
exclude: /node_modules/
},
{
// https://github.com/jtangelder/sass-loader
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
include: /flexboxgrid/,
exclude: /\.c\.scss$/
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader'],
include: /flexboxgrid/,
exclude: /\.c\.scss$/
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader'],
exclude: /(flexboxgrid)|(\.c\.scss)$/
},
{
test: /\.c\.scss$/,
loaders: [
'style-loader?singleton',
{
loader: 'css-loader',
query: {
modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]'
}
},
'sass-loader'
],
exclude: /(node_modules)/
}
]
},
devServer: {
contentBase: __dirname + '/public'
},
plugins: [
new webpack.DefinePlugin({
'process.env.BROWSER': JSON.stringify(true)
}),
new CleanWebpackPlugin(['css/main.css', 'js/bundle.js'], {
root: __dirname + '/public',
verbose: true,
dry: false // true for simulation
})
]
};