diff --git a/.babelrc.js b/.babelrc.js index 4aefc94506..45f7c9c692 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -1,21 +1,29 @@ +"use strict"; + +let envOpts = { + loose: true +}; + module.exports = { - "comments": false, - "presets": [ + comments: false, + presets: [ [ - "env", - { - "loose": true - } + "env", envOpts ], "stage-0", - "flow" + "flow", ], - "env": { - "cov": { - "auxiliaryCommentBefore": "istanbul ignore next", - "plugins": [ - "istanbul" - ] + env: { + cov: { + auxiliaryCommentBefore: "istanbul ignore next", + plugins: ["istanbul"] } } }; + +if (process.env.BABEL_ENV === 'development') { + envOpts.targets = { + node: "current" + }; + envOpts.debug = true; +}; diff --git a/Makefile b/Makefile index 87192cbfbf..a071675043 100644 --- a/Makefile +++ b/Makefile @@ -16,16 +16,16 @@ build-dist: build watch: clean rm -rf packages/*/lib - ./node_modules/.bin/gulp watch + BABEL_ENV=development ./node_modules/.bin/gulp watch lint: - ./node_modules/.bin/eslint scripts packages Gulpfile.js --format=codeframe + ./node_modules/.bin/eslint scripts packages *.js --format=codeframe flow: ./node_modules/.bin/flow check fix: - ./node_modules/.bin/eslint scripts packages Gulpfile.js --format=codeframe --fix + ./node_modules/.bin/eslint scripts packages *.js --format=codeframe --fix clean: test-clean rm -rf packages/babel-polyfill/browser* diff --git a/scripts/babel-register.js b/scripts/babel-register.js index e4aafa37d1..64ee13e04a 100644 --- a/scripts/babel-register.js +++ b/scripts/babel-register.js @@ -2,18 +2,6 @@ const babel = require("../.babelrc"); const register = require("babel-register").default; -const path = require("path"); - -if (babel.plugins) { - // correct path of relative plugins - babel.plugins = babel.plugins.map(function (plugin) { - if (plugin.charAt(0) === ".") { - return plugin.replace(/^\./, path.join(__dirname, "..")); - } - - return plugin; - }); -} register(babel); register({