Using BUILD_PATH environment variable with webpack

This commit is contained in:
Jeff Avallone 2017-07-29 20:40:24 -04:00
parent 9aaf1827ca
commit 9630b26ed3
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
var path = require('path'), var path = require('path'),
_ = require('lodash'), _ = require('lodash'),
buildRoot = process.env.BUILD_PATH || './build', buildRoot = process.env.BUILD_PATH || path.join(__dirname, './build'),
buildPath = _.bind(path.join, path, buildRoot); buildPath = _.bind(path.join, path, buildRoot);
module.exports = { module.exports = {

View File

@ -1,5 +1,6 @@
var webpack = require('webpack'), var webpack = require('webpack'),
bourbon = require('bourbon'); bourbon = require('bourbon'),
config = require('./config');
module.exports = { module.exports = {
devtool: 'source-map', devtool: 'source-map',
@ -9,7 +10,7 @@ module.exports = {
'__discard__/css/svg.css.js': './src/sass/svg.scss' '__discard__/css/svg.css.js': './src/sass/svg.scss'
}, },
output: { output: {
path: __dirname + '/build', path: config.buildRoot,
filename: '[name]' filename: '[name]'
}, },
plugins: [ plugins: [