-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
61 lines (54 loc) · 1.57 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
'use strict';
var autoprefixer = require('autoprefixer');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var cssnano = require('cssnano');
var path = require('path');
var webpack = require('webpack');
module.exports = {
context: path.join(__dirname, 'bundles'),
entry: {
main: './main/main.js',
error: './error/error.js',
signup: './signup/signup.js',
signin: './signin/signin.js',
quest: './quest/quest.js',
quests: './quests/quests.js',
newQuest: './new-quest/new-quest.js',
notification: './notification/notification.js',
user: './user/user.js'
},
output: {
path: path.join(__dirname, 'public'),
filename: '[name].bundle.js',
publicPath: '/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.styl$/,
loader: ExtractTextPlugin.extract('style',
'css-loader!postcss-loader!stylus-loader')
},
{
test: /\.(gif|png|jpg|svg)$/,
loader: 'file-loader',
exclude: /node_modules/
}
]
},
plugins: [
new ExtractTextPlugin('[name].bundle.css'),
new webpack.optimize.UglifyJsPlugin(),
new webpack.ProvidePlugin({
fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
],
postcss: [
autoprefixer, cssnano
]
};