-
Notifications
You must be signed in to change notification settings - Fork 101
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
Added support for Browserify #97
base: master
Are you sure you want to change the base?
Conversation
First, thanks so much for taking this on! It’s something we’ve wanted in Harp for a while, and to see it put together with tests and everything—nice job. It seems to work really well, I am impressed. One minor problem, it seems to work great if you’re running
If you have a
It looks like it’s still going through the minifier, but looking for the file in reference to where I also think it might make sense to just do this to all We’d also need to add the ability to ignore directories, since you don’t want your Seriously nice job! |
Thanks, I'm glad I can contribute to the project. |
Hey @vbwx, thank you so much for your help on this. We have it merged and tagged in #122 with all your commit history in tact. We’ll be writing more about the change when we get the next release of Harp out with this Terraform update. We’re really excited about Browserify support, thanks for your work on it! |
Hello,
after discovering Harp I've really wanted to have a way of concatenating JS files without adding a compilation step, so I went ahead and added Browserify to the pipeline. (Only now I've discovered PR #33, but I still want to share.)
It works by detecting references to
require
/module
/exports
in both JavaScript and CoffeeScript files, unless they're being declared (We wouldn't want Browserify to interfere with scripts that use their ownrequire
function.)This mechanism works out-of-the-box with .coffee files, however, for raw JS you need to use the filename extension .es (as in ECMAScript), otherwise the file never goes through terraform (from what I've seen).
The languages of browserified files can be mixed, as demonstrated in the test suite.