From 9630b26ed3b60bf68438feb45eebafcafbe44f01 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 29 Jul 2017 20:40:24 -0400 Subject: [PATCH] Using BUILD_PATH environment variable with webpack --- config.js | 2 +- webpack.config.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index d3b74c2..52bf918 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,6 @@ var path = require('path'), _ = require('lodash'), - buildRoot = process.env.BUILD_PATH || './build', + buildRoot = process.env.BUILD_PATH || path.join(__dirname, './build'), buildPath = _.bind(path.join, path, buildRoot); module.exports = { diff --git a/webpack.config.js b/webpack.config.js index 132ac3b..acd6e80 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require('webpack'), - bourbon = require('bourbon'); + bourbon = require('bourbon'), + config = require('./config'); module.exports = { devtool: 'source-map', @@ -9,7 +10,7 @@ module.exports = { '__discard__/css/svg.css.js': './src/sass/svg.scss' }, output: { - path: __dirname + '/build', + path: config.buildRoot, filename: '[name]' }, plugins: [