Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browserified npm modules #34

Closed
Risto-Stevcev opened this issue May 13, 2016 · 4 comments
Closed

Browserified npm modules #34

Risto-Stevcev opened this issue May 13, 2016 · 4 comments

Comments

@Risto-Stevcev
Copy link

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:

(browserify :package "snabbdom" :entry "modules/class.js" :standalone "snabbdom_class" :out "snabbdom-class.js")

Which would do this under the hood:

$ npm install snabbdom
$ browserify node_modules/snabbdom/modules/class.js --standalone snabbdom_class -o snabbdom-class.js

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.

@Deraen
Copy link
Member

Deraen commented Sep 7, 2016

I don't think we will provide specific Browserify task, but I'm thinking about creating general npm task.

@burn2delete
Copy link

There is a boot-npm task that could be extended to support these use cases

@Deraen
Copy link
Member

Deraen commented Sep 7, 2016

npm task is tracked here: #39

@Deraen
Copy link
Member

Deraen commented Dec 12, 2017

New run-commands task can be used to run Npm, node etc.

@Deraen Deraen closed this as completed Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants