Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Feature Request: Environment switching #3

Open
geekytime opened this issue Dec 15, 2011 · 3 comments
Open

Feature Request: Environment switching #3

geekytime opened this issue Dec 15, 2011 · 3 comments
Labels

Comments

@geekytime
Copy link

It would be great if this plugin could be used to provide an automated, build-time way to switch html back and forth between unminified dev versions and minified prod versions of JS files. This could be done by directly updating the HTML, but it might be nicer if it worked something like this:

  • Html references a js file that is generated by the plugin
  • When in DEV/UNMINIFIED mode, the generated js file uses Steal.js or Require.js (also configurable), to pull in dependencies as individual files
  • When in PROD/MINIFIED mode, the the generated JS file could just be the minified js file itself
  • A similar system could perhaps also be used to apply version numbers to the scheme?

Thanks for the cool plugins. I've just started using them, but so far they're a great solution to an annoying problem.

@ghost ghost assigned eriwen Dec 16, 2011
@eriwen
Copy link
Owner

eriwen commented Dec 16, 2011

I've been thinking about how to use properties to do this. How it'd work is you'd invoke gradle -Penv=dev taskName which would default to the DEV environment. That work for you?

@geekytime
Copy link
Author

I think that'd work. I wonder if the simple name 'env' wouldn't eventually
collide with other plugins? Should it maybe be 'jsenv' and 'cssenv'
instead?

It might also be nice to have some sort of cascading overrides. So it'd
default to dev, but you can override it either in the gradle script, or if
you pass in the script property, that'll override both. That way teams
have the option of picking their own "default" value for each script.
Also, if you have multiple js files, you might want some to always remain
uncompressed, unminified, etc. I guess in that case, you might not want to
override the value in the script.

Hmmm....

On Thu, Dec 15, 2011 at 6:30 PM, Eric Wendelin <
[email protected]

wrote:

I've been thinking about how to use properties to do this. How it'd work
is you'd invoke gradle -Penv=dev taskName which would default to the DEV
environment. That work for you?


Reply to this email directly or view it on GitHub:
#3 (comment)

@eriwen
Copy link
Owner

eriwen commented Feb 5, 2012

Related, see issue #12 - I recommend doing it the way I suggest there until we get this figured out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants