From a3492f8dc8141cd3042e8d24e87e6953250324ba Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Tue, 17 Jul 2018 22:26:56 -0500 Subject: [PATCH] babel configured to extend dapp's .babelrc --- lib/pipeline/webpackProcess.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pipeline/webpackProcess.js b/lib/pipeline/webpackProcess.js index ca917d3c6..f3f301c50 100644 --- a/lib/pipeline/webpackProcess.js +++ b/lib/pipeline/webpackProcess.js @@ -5,6 +5,7 @@ const fs = require('../core/fs'); const constants = require('../constants'); const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); const ProcessWrapper = require('../process/processWrapper'); +const path = require('path'); let webpackProcess; @@ -15,7 +16,7 @@ class WebpackProcess extends ProcessWrapper { async.waterfall([ function findImports(next) { - self.webpackRun(file.filename, {}, false, importsList, false, next); + self.webpackRun(file.filename, {}, false, importsList, false, realCwd, next); }, function changeCwd(next) { @@ -25,7 +26,7 @@ class WebpackProcess extends ProcessWrapper { }, function runWebpack(next) { - self.webpackRun(file.filename, {}, true, importsList, true, next); + self.webpackRun(file.filename, {}, true, importsList, true, realCwd, next); }, function changeCwdBack(next) { @@ -39,7 +40,7 @@ class WebpackProcess extends ProcessWrapper { } - webpackRun(filename, options, includeModules, importsList, detectErrors, callback) { + webpackRun(filename, options, includeModules, importsList, detectErrors, realCwd, callback) { let defaultOptions = { entry: fs.dappPath(filename), output: { @@ -82,6 +83,7 @@ class WebpackProcess extends ProcessWrapper { loader: "babel-loader", exclude: /(node_modules|bower_components)/, options: { + extends: path.join(realCwd, '.babelrc'), presets: ['babel-preset-es2016', 'babel-preset-es2017', 'babel-preset-react'].map(require.resolve), plugins: ["babel-plugin-webpack-aliases"].map(require.resolve), compact: false