From 421927d81594c4adfc7755dd5f8021fbc77011d6 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Fri, 17 Aug 2018 17:55:59 -0500 Subject: [PATCH] paths more DRY --- lib/pipeline/webpack.config.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/pipeline/webpack.config.js b/lib/pipeline/webpack.config.js index 11f81aff8..f024c4664 100644 --- a/lib/pipeline/webpack.config.js +++ b/lib/pipeline/webpack.config.js @@ -28,8 +28,11 @@ const embarkPath = process.env.EMBARK_PATH; const embarkAliases = require(path.join(dappPath, '.embark/embark-aliases.json')); const embarkAssets = require(path.join(dappPath, '.embark/embark-assets.json')); +const embarkNodeModules = path.join(embarkPath, 'node_modules'); const embarkJson = require(path.join(dappPath, 'embark.json')); +const buildDir = path.join(dappPath, embarkJson.buildDir); + // it's important to `embark reset` if a pkg version is specified in // embark.json and changed/removed later, otherwise pkg resolution may behave // unexpectedly, e.g. a different version may get used owing to lexographical @@ -119,7 +122,7 @@ const base = { // see: https://github.com/webpack/webpack/issues/6522#issuecomment-371120689 globalObject: 'typeof self !== \'undefined\' ? self : this', libraryTarget: 'umd', - path: path.join(dappPath, embarkJson.buildDir) + path: buildDir }, plugins: [new HardSourceWebpackPlugin()], // profiling and generating verbose stats increases build time; if stats @@ -133,13 +136,13 @@ const base = { modules: [ ...versions, 'node_modules', - path.join(embarkPath, 'node_modules') + embarkNodeModules ] }, resolveLoader: { modules: [ 'node_modules', - path.join(embarkPath, 'node_modules') + embarkNodeModules ] } };