From e0dbb1e7700a970d9a756a02f582bd8aff971040 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 4 Oct 2016 02:58:26 +0200 Subject: [PATCH] Inline shebang-regex (#4650) --- packages/babel-core/package.json | 1 - packages/babel-core/src/transformation/file/index.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 9eeacd0dd2..a395c45ee2 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -42,7 +42,6 @@ "path-exists": "^1.0.0", "path-is-absolute": "^1.0.0", "private": "^0.1.6", - "shebang-regex": "^1.0.0", "slash": "^1.0.0", "source-map": "^0.5.0" }, diff --git a/packages/babel-core/src/transformation/file/index.js b/packages/babel-core/src/transformation/file/index.js index 617fde6b1d..7a3bc883f7 100644 --- a/packages/babel-core/src/transformation/file/index.js +++ b/packages/babel-core/src/transformation/file/index.js @@ -7,7 +7,6 @@ import convertSourceMap from "convert-source-map"; import OptionManager from "./options/option-manager"; import type Pipeline from "../pipeline"; import PluginPass from "../plugin-pass"; -import shebangRegex from "shebang-regex"; import { NodePath, Hub, Scope } from "babel-traverse"; import sourceMap from "source-map"; import generate from "babel-generator"; @@ -26,6 +25,8 @@ import resolve from "../../helpers/resolve"; import blockHoistPlugin from "../internal-plugins/block-hoist"; import shadowFunctionsPlugin from "../internal-plugins/shadow-functions"; +const shebangRegex = /^#!.*/; + const INTERNAL_PLUGINS = [ [blockHoistPlugin], [shadowFunctionsPlugin]