diff --git a/js/.babelrc b/js/.babelrc index 5c99af2ea..505a3027d 100644 --- a/js/.babelrc +++ b/js/.babelrc @@ -1,7 +1,6 @@ { "presets": [ - "es2017", "es2016", - [ "es2015", { "modules": false } ], + "es2017", "es2016", "es2015", "stage-0", "react" ], "plugins": [ diff --git a/js/package.json b/js/package.json index ad944dc85..633aa7ed3 100644 --- a/js/package.json +++ b/js/package.json @@ -104,7 +104,7 @@ "postcss-loader": "~1.1.1", "postcss-nested": "~1.0.0", "postcss-simple-vars": "~3.0.0", - "progress": "^1.1.8", + "progress": "~1.1.8", "raw-loader": "~0.5.1", "react-addons-perf": "~15.3.2", "react-addons-test-utils": "~15.3.2", diff --git a/js/webpack/shared.js b/js/webpack/shared.js index 19c3cd770..b61743154 100644 --- a/js/webpack/shared.js +++ b/js/webpack/shared.js @@ -26,6 +26,13 @@ const rucksack = require('rucksack-css'); const ENV = process.env.NODE_ENV || 'development'; const isProd = ENV === 'production'; +function getBabelrc () { + const babelrc = require('../.babelrc'); + const es2015Index = babelrc.presets.findIndex((p) => p === 'es2015'); + babelrc.preset[es2015Index] = [ 'es2015', { modules: false } ]; + return babelrc; +} + function getPlugins (_isProd = isProd) { const postcss = [ postcssImport({ @@ -154,6 +161,7 @@ function addProxies (app) { } module.exports = { + getBabelrc: getBabelrc, getPlugins: getPlugins, dappsEntry: getDappsEntry(), addProxies: addProxies