antiaris-transform-commonjs-modules-systemjs

1.3.0 • Public • Published

antiaris-transform-commonjs-modules-systemjs

NPM version Downloads Build Status Dependency status Dev Dependency status

CommonJS 风格模块转换为 System.register 风格。

import {transform, transformFile} from 'antiaris-transform-commonjs-modules-systemjs';
 
transform('require("./bar.js");\nmodule.exports = 43;', {
    moduleId: 'foo',
    isStrict: true,
    isSlient: true,
    translateDep: function(dep) {
        return path.basename(dep, '.js');
    }
}, function(err, result) {
    console.log(result.code);
    /*System.registerDynamic('foo', ['bar'], true, function(require, exports, module) {
    var define, global = this, GLOBAL = this;
 
    require('bar');
    module.exports = 43;
 
    return module.exports;
    });*/
});
 

ES2015 modules 语法将会被忽略。

Package Sidebar

Install

npm i antiaris-transform-commonjs-modules-systemjs

Weekly Downloads

2

Version

1.3.0

License

MIT

Last publish

Collaborators

  • yinyongcom666