0

I am new to AngularJS and Grunt world. I am trying to setup FE environment and want to figure out a way to serve compressed or uncompressed js and css based on url parameters.

For example, by default I want compressed files.. if I append &debug_js=true //I want browser to serve uncompressed js files.. &debug_css=true //I want browser to serve uncompressed css files.. &debug_css=true&debug_js=true //I want browser to serve uncompressed js and css files..

Thanks in advance!

2 Answers2

0

Was just thinking about this today! Here's what I came up with:

If you have access to server side, you could read the query parameter there and write out the uncompressed script references

If you want to do it client side, you could create simple function that document.write's out your script references depending on the query parameter

user1857711
  • 117
  • 2
0

After looking at couple of other references, I found similar article which addresses this question: Have Grunt generate index.html for different setups

Community
  • 1
  • 1