breaking: throw on missing dynamic import when import() is seen in systemjs (#12700)

This commit is contained in:
Huáng Jùnliàng
2021-01-29 13:14:13 -05:00
committed by GitHub
parent 3d69dc9471
commit f8fe8eaab1
7 changed files with 25 additions and 6 deletions

View File

@@ -0,0 +1,3 @@
import "a";
import("b");

View File

@@ -0,0 +1,8 @@
{
"validateLogs": true,
"plugins": [
"transform-modules-systemjs",
"external-helpers"
],
"BABEL_8_BREAKING": false
}

View File

@@ -4,7 +4,6 @@ System.register(["a"], function (_export, _context) {
return {
setters: [function (_a) {}],
execute: function () {
// TODO: This should throw in Babel 8
_context.import("b");
}
};

View File

@@ -1,5 +1,3 @@
// TODO: This should throw in Babel 8
import "a";
import("b");

View File

@@ -1,7 +1,8 @@
{
"validateLogs": true,
"plugins": [
"transform-modules-systemjs",
"external-helpers"
]
],
"BABEL_8_BREAKING": true,
"throws": "ERROR: Dynamic import() transformation must be enabled using the\n @babel/plugin-proposal-dynamic-import plugin. Babel 8\n no longer transforms import() without using that plugin."
}