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