global-modulename
Transform that allows for a new statically-compiled global: __modulename
.
This global is resolved to the name of the containing (sub)module.
Mostly this will resolve to the basename of the containing file with the extension stripped off, unless the file is named index.*
, in which case the name of the parent directory is used.
Installation
Usage
browserify -t global-modulename entry.js > bundle.js