global-pack

1.1.1 • Public • Published

Global-pack

Like browser-pack, but mounts modules to window.modules (or a specified scope).

Whereas browser-pack emits strings of Javascript that must be concatenated to run as valid JS and defines modules within an internal scope, global-pack emits strings that are themselves valid JS and defines modules in window.modules. This allows you to split each dep into a separate file and embed it via a <script> tag.

Options

  • scope: String. The scope to mount modules. Defaults to window.modules.
  • objectMode: Boolean. If true, emit objects instead of strings. For every module-dep object ingested, the same object will be emitted with a content property set to the packed JS. Warning: global-pack will also emit two extra objects, prelude and postlude, whose properties include only id and content.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    1,242
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    1,242
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i global-pack

Weekly Downloads

895

Version

1.1.1

License

ISC

Last publish

Collaborators

  • chrkirk