aster-commonjs
Bundle CommonJS with aster.
Usage
First, install aster-commonjs
as a development dependency:
npm install --save-dev aster-commonjs
Then, add it to your build script:
var aster = ;var commonjs = ; aster;
API
commonjs(options)
-
input
:String
|Function()
.
Input file.
Example:'superLib/topModule.js'
-
output
:String
|Function(input)
Output file.
Default:input => input.replace(/(\.js)?$/, '.out.js')
-
external
:{ cjsName: (true | { amd?: String, global?: String }) }
External dependencies (to be excluded from bundling). Example:jquery: truelodash: amd: '../vendor/lodash.js' global: '_' -
exports
:String
|Function(input, output)
Export top module with UMD with given global object name.
Default: no exports. -
defaultExt
:String
Default extension for require calls ("js"
).