Example of browserify with export. require()
is split into reqs.js, which is used as the input to browserify for fetching all dependencies. reqs.js
is prepended to index.js
, so whatever is exposed in reqs.js
will be available in index.js
. prelude.js
is a custom prelude used for the browserify, it basically changes the function to instead return a requires function for our reqs.js
. We can't assign that to require straight away though since that would lead to infinite recursion if a module can't be found, instead it's assigned to a temporary __tmpReq
, which afterwards is assigned to require
. To test the example run npm install
followed by npm run-script build
, then just serve index.html
with your favorite web server.
-
Notifications
You must be signed in to change notification settings - Fork 0
Sairony/browserify-export-example
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Example of browserify with export
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published