3 ms·
You'd include all the modules as separate script files. Each script file is a revealing module[0] that exports its API to a global variable. If you're intereste
by guscost 10y ago
You'd include all the modules as separate script files. Each script file is a revealing module[0] that exports its API to a global variable. If you're interested I could put together a more complete boilerplate. I don't actually use this approach much in front-end work these days, but it can be nice to work with just text editor and browser.
As for building it, you're on your own. You could run jsx from the command line, concat them all together and minify.
http://stackoverflow.com/questions/5647258/how-to-use-revealing-module-pattern-in-javascript http://stackoverflow.com/questions/5647258/how-to-use-reveal...
- darth_mastah 10y agoI may be wrong, but I use webpack to remove exactly the the pain point of running jsx from the command line, concatenating files and minifying them. It does good job there and saves me time.
- guscost 10y agoIt's a good solution, but webpack can be overwhelming to newcomers, and it sometimes can lock you into working with associated dev tools like webpack-dev-server and all the various loaders.