supporting both CommonJS and AMD

后端 未结 6 2257
臣服心动
臣服心动 2020-11-29 18:15

Is there a way to create a javascript micro-library (a library that has no dependencies), that support all of the following module formats:

  • Asynchronous Module
6条回答
  •  清酒与你
    2020-11-29 19:14

    uRequire, the Universal Module & Resource Converter is the tool that does exactly that.

    • It mainly converts AMD and CommonJS to UMD / AMD / CommonJS / Plain script (no AMD loader required).

    • It allows declarative exporting of modules, with a noConflict() baked in.

    • It can manipulate modules (inject/replace/remove dependencies OR code) as you build them.

    • It converts from coffeescript, coco, Livescript, icedCoffeescript and you can add your own conversions in one liners!

提交回复
热议问题