Skip to content

Sairony/browserify-export-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

browserify-export-example

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.

About

Example of browserify with export

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published