umd-name-transform
v1.0.1 UMD rollup stream transform
umd-name-transform
Transform stream for UMD bundle names
Why
Lets say you have a scoped npm package with some esnext code and you want to say use rollup to bundle it for the browser with UMD.
rollup -c --name '@somescope/somepackagename' -o dist/somepackagename.js
the result will be
factory((global.@somescope/somepackagename = {})
This module attempts to fix that so that results looks like
factory((global['@somescope/somepackagename']= {})
Also will convert dashes to camelcase my-module-with-dashes
to myModuleWithDashes
Install
npm install umd-name-transform --save-dev
Usage
rollup -c --name '@somecope/somepackagename' | umd-name-transform -o dist/somepackagename.js
This will transform the output from rollup and write to dist/somepackagename.js
Note this module assumes that you have created the given directories in the above case its dist
if your are using cli:
mkdir -p nameOfDir && rollup -c --name '@somecope/somepackagename' | umd-name-transform -o nameOfDir/somepackagename.js
TODO
- Programmatic API support