Closed Risto-Stevcev closed 6 years ago
I don't think we will provide specific Browserify task, but I'm thinking about creating general npm task.
There is a boot-npm task that could be extended to support these use cases
npm task is tracked here: https://github.com/cljsjs/boot-cljsjs/issues/39
New run-commands
task can be used to run Npm, node etc.
There are lot of JS libraries that are written to only work with browserify (such as snabbdom). There is a CDN called wzrd.in for browserify modules, but it's poorly implemented. I've barely used it and I've had multiple issues with it. It doesn't support peer dependencies (which motor/cycle needs) or choosing the entry point (which snabbdom needs). It also doesn't bundle the way browserify does, it just concatenates multiple standalone bundles, which can result in unusual behavior, and the author made it clear that he doesn't want to fix it.
I propose having a
browserify
boot task that can make the process of including those libraries simpler.Node, npm and browserify would be installed on the CLJSJS end. Then the task would just install the package and run the globally installed browserify task with the given params, so it shouldn't be too hard to implement.
The task can take in the browserify optional and required parameters: entry points, the UMD module name, and output file (see usage).
For example:
Which would do this under the hood:
Then it would be easy to include browserify modules like snabbdom, by just running the
browserify
task for all of the entry points/submodules it provides (class, props, style, events, and h), concatenating and miniftying it, and the you're done.