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');// configure what we want to exposevar exposeConfig ={expose:{jquery:'$',three:'THREE'}};browserify().require(require.resolve('./main'),{entry:true}).transform('exposify', exposeConfig).bundle({debug:true}).pipe(fs.createWriteStream(path.join(__dirname,'bundle.js'),'utf8'))
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.
var b = browserify();
// setting via transform argument
b.transform('exposify', { expose: { jquery: '$', three: 'THREE' } });