@babel/plugin-syntax-dynamic-import
"plugins": ["@babel/plugin-syntax-dynamic-import"]
}
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-syntax-dynamic-import"],
});
Currently, @babel/preset-env
is unaware that using with Webpack relies on Promise internally. Environments which do not have builtin support for Promise
, like Internet Explorer, will require both the promise
and iterator
polyfills be added manually.
or
// src/main.js
import "core-js/modules/es.array.iterator";
// ...
or
// src/main.js
import "core-js/modules/es6.promise";
import "core-js/modules/es6.array.iterator";
// ...