-
-
Notifications
You must be signed in to change notification settings - Fork 87
Always call browserify-shim from package.json via Browserify's "transform" attribute.
"browserify": "transform": ["browserify-shim"]
When calling browserify-shim via Browserify's API, shim will only transform files within the scope of the parent package.json file. As per the Browserify docs for b.transform()
:
If opts.global is true, the transform will operate on ALL files, despite whether they exist up a level in a node_modules/ directory.
However, as of 1.7.0, adding browserify-shim via b.transform({global: true}, shim);
or b.transform({global: true}, 'browserify-shim');
will cause unpredictable results. The sanctioned method above using package.json will still allow inline Browserify API calls to include the browserify-shim transform. There is no need to use b.transform();