use node current in dev

This commit is contained in:
Henry Zhu 2017-03-27 12:30:38 -04:00
parent 4278ede41f
commit 18bbaa0253
3 changed files with 24 additions and 28 deletions

View File

@ -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;
};

View File

@ -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*

View File

@ -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({