Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
babel-plugin-transform-system-import-commonjs
Advanced tools
Transform ES2015 System.import to CommonJS require
Babel plugin that transforms ES2015 System.import into CommonJS require.
** Since import() proposal was accepted, System.import
function now is obsolete and this plugin is not recommended to use in new projects. Please use import()
function with babel-plugin-transform-import-commonjs instead. **
This plugin transforms
var myModule = "./path/to/myModule";
System.import(myModule).then(function (module) {
console.log(module);
});
to
var myModule = "./path/to/myModule";
new Promise(function(resolve) {
resolve(require(myModule));
}.bind(this)).then(function (module) {
console.log(module);
});
You need support for Promise, use polyfill if needed.
$ npm install babel-plugin-transform-system-import-commonjs
.babelrc
(Recommended).babelrc
{
"plugins": ["transform-system-import-commonjs"]
}
$ babel --plugins transform-system-import-commonjs script.js
require("babel-core").transform("code", {
plugins: ["transform-system-import-commonjs"]
});
FAQs
Transform ES2015 System.import to CommonJS require
The npm package babel-plugin-transform-system-import-commonjs receives a total of 0 weekly downloads. As such, babel-plugin-transform-system-import-commonjs popularity was classified as not popular.
We found that babel-plugin-transform-system-import-commonjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.