browserify transform that exposes globals added via a script tag as modules so they can be required.
Package Exports
exposify
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (exposify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
exposify
browserify transform that exposes globals added via a script tag as modules so they can be required.
var browserify =require('browserify'), exposify =require('exposify')// configure what we want to expose
exposify.config ={jquery:'$',three:'THREE'};browserify().require(require.resolve('./main'),{entry:true}).transform(exposify).bundle({debug:true}).pipe(fs.createWriteStream(path.join(__dirname,'bundle.js'),'utf8'))
Or use it via browserify-shim which allows you to provide exposify config
inside your package.json among other features.
Installation
npm install exposify
API
exposify::config
The config which is used by exposify to determine which require statemtents to replace and how.
You need to set this or provide it via the EXPOSIFY_CONFIG environment variable.