Socket
Socket
Sign inDemoInstall

amd-bundle

Package Overview
Dependencies
191
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amd-bundle

A dual-use tool for bundling up AMD modules, which is much easier to use than r.js with Almond or AMDclean


Version published
Weekly downloads
7
decreased by-75%
Maintainers
1
Install size
24.4 MB
Created
Weekly downloads
 

Readme

Source

AMD bundle

A multiple-use tool for bundling up AMD, CJS & ES 6 modules, which is much easier to use than r.js with Almond or AMDclean.

NPM Dependency Build Status

NPM

Basic

cd path/to/project/root

npm install amd-bundle --save-dev

amd-bundle -a -m \
    path/to/project/source/entry \
    path/to/project/bundle/file

amd-bundle will

  1. start bundling from the entry point path/to/project/source/entry.js

  2. write into path/to/project/bundle/file.js with only one define('file', [ ]) and global.file definition, just like UMD style

  3. treat ${process.cwd()}/node_modules/${module_full_name} as a user's module to pack in

  4. generate file.min.js & file.js.map in path/to/project/bundle/

More options

Command-line

amd-bundle --help

Usage: amd-bundle [options] <entry file> [bundle file]

Options:

    -V, --version      output the version number
    -a, --include-all  Bundle all dependencies (include those in "./node_modules/")
    -m, --minify       Generate minified source code & source map
    -s, --std-out      Write into "stdout" without logs
    -h, --help         output usage information
Configuration

Example

Key/value of option moduleMap is same as the basic parameters of String.prototype.replace().

JS Module

Advanced

Build standalone release files (Full source code, Minimized code & Source map) by executing a single command (npm run build).

Multiple bundles from one source
Bundle ECMAScript 6+ codes
  • Development dependency: Babel

  • NPM-scripts reference: WebCell

Typical Cases

  1. iQuery.js (where the prototype of amd-bundle came from)

  2. WebCell (where v1.0 rewritten out)

  3. WebCell DevCLI (where v1.3+ came out)

More use case

Keywords

FAQs

Last updated on 16 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc