1.0.2 • Published 2 months ago

seatrans v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

seatransform

transform AMD/CommonJS/Module to CMD

NPM version Build Status

API

  • transform(code:String):String

    • transform source code to CMD
    • for CommonJs it will wrap define
    • for AMD it will:
      • delete define.AMD and define.AMD.xxx
      • modify the factory params to require, exports, module
      • add dependence by var dependence = require("dependence") in factory top
    • for ES6 module it will:
      • transform module from: var dependence = require("dependence")
      • transform import from: var property;!function(){var _0_=require("dependence");property=_0_.property;}();
      • also support alias: var alias;!function(){var _0_=require("dependence");alias=_0_.property;}();
      • export var and function: var v;function f(){};exports.v=v;exports.f=f;
      • export default: module.exports=something;
    • for ES6 it will transform to ES5
    • otherwise it will return your source code

INSTALL

npm install seatransform
1.0.2

2 months ago

1.0.1

2 months ago