0.0.0 • Published 5 years ago

webpack-amd-plugin v0.0.0

Weekly downloads
3
License
UNLICENSED
Repository
github
Last release
5 years ago

webpack-amd-plugin

A webpack plugin to emit amd module for each entry file.

Concepts

  • module: A single source file is called module, for example: src/foo.js, src/bar.ts, src/image.svg, etc. module include three kind:
    • script: the module will be executed as script
    • style: the module will be executed as style
    • asset: the module will be treated as external resource, and include two form:
      • inline: which will be convert to data url
      • external: which will be emitted
  • package: A directory contains one or more module or package.

Design

Basic: Transform all specified module to amd module, and emit each of it to a separate file.

What need to do:

  • transform
    • transform all script module to amd format
    • transform all style module to css format
    • transform all asset module to inline or external format
  • create dependency map: any module may dependent on one or more other module
  • create id <-> file map: we must use hash to let cache system works
  • implement amd loader & webpack runtime.

LICENSE

MIT