-
Notifications
You must be signed in to change notification settings - Fork 342
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
Add support for browserify #55
Comments
Hey @michael-lawrence, JavaScript compression is planned: #54 I believe there’s a plan for compilation that wouldn’t involve Browserify. But just to make sure I understand the use case, you have a bunch of JavaScript files that you’d like reference using a single script tag? |
@kennethormandy Correct. The thing that makes browserify great is that it uses the CommonJS spec and npm modules. This makes it pretty easy to share code/modules between the server and client. Also, it allows you to specify a transform module that allows for some pretty cool stuff like precompiling handlebars or jade templates and bundling those templates in your single .js file. |
That would be cool to have in Harpjs, but how would you mark the file that it should be browserify?
|
You could just add a configuration option in the root harp.json. Something like browserify: ['app.js', 'main.js']. That way you don't have to have any special made up extensions. Alternately, you could do something like main.bundle.js and that could become main.js, so you just watch for .bundle.js files (or .bify.js files). |
I like the idea of that, if the file name features '.bundle.', it will be browerify. |
I like the idea of adding browserify support. Esp if it can be achieved through a convention rather than through configuration. We'll keep this issue open for exploring this feature. |
I can see that assets is processed with the module terraform which is broke out of Harpjs. If you wanted to do it, how would you go around and implement browserify? |
@kevinsimper great to hear you want to chip in. I think browserify support is definitely worth exploring. I would start by proposing a design that can be added to the Harp Spec for how browserify should work. My suggestion would be to put that in a gist or some place where we can iterate on the design. Once we have a design that we feel aligns with the philosophy of the project then the next step would be to put this in a milestone and get you familiar with the terraform codebase. I would be happy to give you a walk through if you like. We then write some tests and come up with a plan of attack with the implementation. If you have any other questions on how to move forward or want clarification on the design goals, come find me on #harp (irc.freenode.net). |
Reviving this thread. @kevinsimper did you make any progress on this? I'm happy to help out if I can. |
@sintaxi's above link to the spec is outdated. It now resides at spec.harp.io |
@zeke Fixed that, thanks. |
Would also love to see this. Using Gulp now to get around not having it in Harp. |
I found a simpler solution and create a boilerplate, which can easily be used by saying |
@kevinsimper this is a great interim option in the absence of first-class browserify support in Harp. Nice and minimal. Thanks for sharing. |
Do we even need a configuration or convention for this? Can't we serve all JavaScript through browserify? If the file doesn't contain any Or maybe add a flag to |
@Prinzhorn indeed. we will have to figure out how this should work. I think you just described the optimal scenario. Thats what I'm hoping we can achieve. it should work identically with coffee-script. |
Following up my comment on live reload (#80 (comment)) I'm now doing this
in combination with
and I'm happy with it :) I'm not saying integrating it into harp would be a bad thing, but this way I know exactly what everything is doing. |
+1 for @Prinzhorn's comment. It's been almost a year... any progress? |
Reviving this from the dead, has there been any movement on this feature? Or does this has to be implemented in terraform? EDIT: I see terraform has an open request for this sintaxi/terraform#97 |
I would very much like to see it happen. |
trying to revive it in 2018. Has any progress being made on that? |
This has been implemented but not announced. Add a |
does it work with harp being install globally. because It doesn't seem to work. |
First off, I have to say this looks amazing! The only thing I think it's really lacking is client-side JavaScript compilation and minification. I think browserify would be a match made in heaven! Any chance that we might see support for browserify added? Thanks!
The text was updated successfully, but these errors were encountered: