-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
89 lines (87 loc) · 1.91 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
'use strict'
const webpack = require('webpack')
const isProduction = process.env.NODE_ENV === 'production'
const path = require('path')
let plugins = [
new webpack.DefinePlugin({
__IS_BROWSER__: true,
}),
new webpack.LoaderOptionsPlugin({
debug: false,
}),
]
if (isProduction) {
// Disable development features in React in production build
plugins = plugins.concat([new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),])
}
module.exports = {
context: __dirname + '/app',
entry: {
muzhack: [
'babel-polyfill',
'./entry.js',
],
workshops: [
'babel-polyfill',
'./workshopsEntry.js',
],
},
output: {
path: __dirname + '/dist',
filename: '[name].bundle.js',
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
},
{
test: /\.styl$/,
loader: 'style-loader!raw-loader!stylus-loader',
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
{
test: /\.(eot|woff|woff2|ttf|svg)($|\?)/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]',
},
{
test: /(isotope|masonry|outlayer|item|get-size|fizzy-ui-utils\/utils)\.js$/,
loader: 'imports-loader?define=>false',
},
{
test: /\.json$/,
loader: 'json-loader',
},
{
test: /\.coffee$/,
loader: 'coffee-loader',
exclude: /node_modules/,
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader',
exclude: /node_modules/,
},
],
},
resolve: {
modules: [__dirname, 'node_modules', path.resolve(__dirname, 'lib'),],
extensions: ['.js',],
},
devServer: {
historyApiFallback: false,
proxy: {
'**': 'http://localhost:8000',
},
},
plugins,
}