forked from pacoccino/stellar-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
64 lines (59 loc) · 1.68 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
const {
addPlugins, resolveAliases, createConfig, defineConstants, entryPoint, env, performance, setOutput, sourceMaps, webpack
} = require('@webpack-blocks/webpack2');
const path = require('path');
const babel = require('@webpack-blocks/babel6');
const cssModules = require('@webpack-blocks/css-modules');
const sass = require('@webpack-blocks/sass');
const devServer = require('@webpack-blocks/dev-server2');
const extractText = require('@webpack-blocks/extract-text2');
const plugins = require('./webpack.plugins');
const config = require('./config');
const appDir = config.appPath;
const buildDir = config.buildPath;
module.exports = createConfig([
setOutput({
filename: '[name].[hash].js',
path: buildDir()
}),
babel(),
cssModules(),
sass(),
addPlugins(plugins.basePlugins),
defineConstants({
'process.env.NODE_ENV': process.env.NODE_ENV || 'development',
}),
resolveAliases({
styles: appDir('styles'),
images: appDir('images'),
js: appDir('js'),
}),
env('development', [
entryPoint({
main: appDir('js/main.js'),
}),
sourceMaps(),
devServer(),
/*devServer.proxy({
'/api/!*': { target: 'http://localhost:4000' }
}),*/
performance({
// Increase performance budget thresholds for development mode
maxAssetSize: 15000000,
maxEntrypointSize: 15000000
})
]),
env('production', [
entryPoint({
main: appDir('js/main.prod.js'),
vendor: 'stellar-sdk'
}),
extractText(),
performance({
// Increase performance budget thresholds for development mode
maxAssetSize: 15000000,
maxEntrypointSize: 15000000
}),
addPlugins(plugins.productionPlugins)
])
]);