From 98bdfa4d053511090dbb75a9c3a2a437d9714245 Mon Sep 17 00:00:00 2001 From: MoOx Date: Sat, 30 Sep 2017 21:44:32 +0200 Subject: [PATCH] ``@phenomic/cli``: Use a dump babel-preset-(env|react) to cover most use case for node executed code Closes #1170 --- packages/cli/index.js | 9 ++++++++- packages/cli/package.json | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index 9ddf04d74..84458a1d5 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -10,7 +10,14 @@ process.env.BABEL_ENV = "development"; // this babel register is mainly so you can have a webpack config file in es6 // without a .babel extension require("babel-register")({ - presets: [require.resolve("@phenomic/babel-preset")], + presets: [ + // used to allow import/export + // see https://github.com/phenomic/phenomic/issues/1170 + require.resolve("babel-preset-env"), + // used to allow react/flow in Html.js for plugin react + // @todo: consider moving babel-register in this plugin for this file only? + require.resolve("babel-preset-react") + ], sourceMap: "inline" }); diff --git a/packages/cli/package.json b/packages/cli/package.json index a18f26c10..6fea0d838 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -15,9 +15,10 @@ }, "files": ["index.js", "lib"], "dependencies": { - "@phenomic/babel-preset": "^1.0.0-alpha.10", "@phenomic/core": "^1.0.0-alpha.10", "babel-register": "^6.24.0", + "babel-preset-env": "^1.6.0", + "babel-preset-react": "^6.24.0", "chalk": "^1.1.3", "debug": "^2.6.0", "semver": "^5.3.0",