-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
56 lines (48 loc) · 1.06 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
'use strict';
/**
* Webpack Development Boilerplate
* Include:
* - stylus
* - jade
* - modular components
* - chunkhashing
* - autoprefixier
* - separated ENV
* - SVG store && SVG min
* - build system
* - etc...
* @author Mike Chernobrov
* @see http://rambler-co.ru
*/
// Depends
var _ = require('lodash');
/**
* Exported evnironments object
* @type {Object}
*/
var _configs = {
// global section
global: require(__dirname + '/config/webpack/global'),
// config by enviroments
production: require(__dirname + '/config/webpack/environments/production'),
development: require(__dirname + '/config/webpack/environments/development')
};
/**
* Load webpack config via enviroments
* @param {[type]} enviroment [description]
* @return {[type]} [description]
*/
var _load = function() {
var ENV = process.env.NODE_ENV
? process.env.NODE_ENV
: 'production';
return _.merge(
_configs[ENV](__dirname),
_configs.global(__dirname)
);
};
/**
* Export WebPack config
* @type {[type]}
*/
module.exports = _load();