From 4e9f9bda466f117aa98d0e96e8221f04d02e4e0c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 20 Aug 2019 15:56:29 +0200 Subject: [PATCH] REMOVE need for babel-register in our CLI --- lib/cli/bin/index.js | 10 ++-------- lib/cli/package.json | 2 +- yarn.lock | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/cli/bin/index.js b/lib/cli/bin/index.js index 306555fa5b..df4a5a1221 100755 --- a/lib/cli/bin/index.js +++ b/lib/cli/bin/index.js @@ -1,9 +1,3 @@ -#!/usr/bin/env node -const path = require('path'); +#!/usr/bin/env node -r esm -require('@babel/register')({ - // see https://github.com/babel/babel/issues/7701#issuecomment-389720069 - cwd: path.resolve(__dirname, '..'), - only: [new RegExp(`(@storybook|lib)${path.sep === '\\' ? '\\\\' : path.sep}cli`)], -}); -require('./generate'); +import './generate'; diff --git a/lib/cli/package.json b/lib/cli/package.json index 30354804a6..0d54319edf 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -29,12 +29,12 @@ "dependencies": { "@babel/core": "^7.4.5", "@babel/preset-env": "^7.4.5", - "@babel/register": "^7.0.0", "@storybook/codemod": "5.2.0-beta.37", "chalk": "^2.4.1", "commander": "^2.19.0", "core-js": "^3.0.1", "cross-spawn": "^6.0.5", + "esm": "3.2.25", "didyoumean": "^1.2.1", "envinfo": "^7.3.1", "fs-extra": "^8.0.1", diff --git a/yarn.lock b/yarn.lock index a1e4c8bf25..d14b27f3fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11768,7 +11768,7 @@ eslint@^5.10.0, eslint@^5.14.1, eslint@^5.16.0: table "^5.2.3" text-table "^0.2.0" -esm@^3.2.25, esm@^3.2.4: +esm@3.2.25, esm@^3.2.25, esm@^3.2.4: version "3.2.25" resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10" integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==