forked from olalonde/deisdash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.build.config.js
70 lines (67 loc) · 1.73 KB
/
webpack.build.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
/* eslint-disable */
// TODO; find a way to use only a single webpack.config.js
var path = require('path')
var webpack = require('webpack')
var pkg = require('./package.json')
var constantsPlugin = new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"',
'process.env.VERSION': JSON.stringify(pkg.version),
'process.env.DEFAULT_CONTROLLER': JSON.stringify(process.env.DEFAULT_CONTROLLER),
'process.env.GA': JSON.stringify(process.env.GA),
})
module.exports = {
entry: [
'./index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
constantsPlugin,
new webpack.optimize.OccurenceOrderPlugin(),
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/,
include: __dirname
},
{
test: /\.scss$/,
loader: 'style!css!sass',
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=application/font-woff',
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=application/font-woff',
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=application/octet-stream',
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file',
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=image/svg+xml',
},
{
test: /\.png(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=image/png',
},
{
test: /\.gif(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&minetype=image/gif',
},
]
}
}