-
Notifications
You must be signed in to change notification settings - Fork 23
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
Closure Compiler support in minification mode only #70
Comments
Hi Flavian, I'm not opposed to adding this (especially if you have a PR with tests). If we added support for Cheers, Dave On 8 April 2015 at 13:05, Flavian Alexandru [email protected]
Dave Gurnell, Untyped |
Hi @davegurnell , Finally got round to wanting to set this straight. 8 months later but nonetheless, I will try to create a PR of this, if you have any warnings or pre-pointers let me know, I'll admit the codebase looks somewhat cryptic as I'm not familiar with the SBT API but otherwise it should be straightforward. Regards, |
Hi Flavian, No pointers that I can think of. Please go ahead. There's some good stuff http://www.scala-sbt.org/0.13/docs/Plugins-Best-Practices.html Best regards, Dave On Wed, Jan 13, 2016 at 7:07 PM Flavian Alexandru [email protected]
|
FYI -- I did a bit of housekeeping today. You may want to rebase if you're launching into dev work:
The big plus is the change to the tests, which should be easier to maintain and more reliable. Cheers, Dave |
Hi,
I wanted to confirm something before moving forward with an API proposal and hopefully a pull request very soon.
The problem
In Google Land, high upon the mountains, the laws of JavaScript dictate one should use adequate package management, with an a-la Java type provisioning system built with 2 compiler primitives, namely
goog.require
andgoog.provide
.This is perhaps the most powerful feature the Closure Compiler has to offer, and to the best of my knowledge the
sbt-js
plugin is completely ignoring it by feeding in JavaScript sources to the compiler in parallel for minification only.Conversely, using the Compiler directly in the "intended" way generally means, beyond the tedious annotations, working with a
deps.js
file, sub-modules that are auto-included, and a very advanced automated dependency generation and compilation system, dead code elimination, etc.Without further ado, I would like to have:
In the following file:
users/users-service.js
And then in:
users/users-controller.js
Why would I go through all this trouble? Well, in an ideal world the compiler would then take care of every single
.js
output file and I would only include the single generated file, just like in the Java world all I need to worry about is a.jar
.Proposed solution
sbt-js
should have a mode of feeding JS sources in the Google-esque way, where files are not individually compiled, but rather the entire output is fed to the compiler call in a single go via--input
directives and a single output file(or one file per module) is being compiled and generated under a specified path.For people who are committed to the Closure Compiler beyond simple minification, this seemingly simple change does introduce a new world of productivity, where you no longer need to include a thousand JS scripts in your header manually.
Is this something that's actively being considered or that you would happily merge as adjacent functionality?
Regards,
The text was updated successfully, but these errors were encountered: