-
Notifications
You must be signed in to change notification settings - Fork 0
/
browser.webpack.config.js
54 lines (51 loc) · 1.16 KB
/
browser.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
const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
output: {
filename: '[name].min.js',
},
resolve: {
modulesDirectories: [ 'bower_components' ],
},
module: {
noParse: [
/\/qs\//,
/\/swagger-js\//,
],
loaders: [
{
test: /.js$/,
exclude: /(node_modules|bower_components)/,
loader : 'babel',
},
{
test: /.js$/,
loader : 'imports',
exclude: /(node_modules|bower_components)/,
query: {
'zepto': 'zepto',
},
},
{
test: /.html$/,
exclude: /(node_modules|bower_components)/,
loader : 'html',
},
],
},
plugins: [
// Expose process.env vars to config.js
new webpack.DefinePlugin({
REKT_API_GATEWAY_ENDPOINT: JSON.stringify(process.env.REKT_API_GATEWAY_ENDPOINT || 'http://localhost:8000'),
}),
// Make Bower work
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', [ 'main' ])),
// Uglify
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
}),
],
};