Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use airbnb/babel-plugin-dynamic-import-node
Do not duplicate code, which will unavoidably lead to bugs being fixed in one plugin and not in the other.
- Loading branch information
1 parent
bd241a4
commit 33ba9d9
Showing
11 changed files
with
36 additions
and
49 deletions.
There are no files selected for viewing
22 changes: 0 additions & 22 deletions
22
packages/babel-helper-module-transforms/src/dynamic-import.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/module/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"use strict"; | ||
|
||
var modP = new Promise(_resolve => _resolve(babelHelpers.interopRequireWildcard(require("mod")))); | ||
var modP = Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require("mod"))); |
2 changes: 1 addition & 1 deletion
2
packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/no-interop/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
var modP = new Promise(_resolve => _resolve(require("mod"))); | ||
var modP = Promise.resolve().then(() => require("mod")); |
2 changes: 1 addition & 1 deletion
2
packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/script/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
var modP = new Promise(_resolve => _resolve(babelHelpers.interopRequireWildcard(require("mod")))); | ||
var modP = Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require("mod"))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/to-string/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import(2); |
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/to-string/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require(`${2}`))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters