How does one avoid minifying JS/CSS when running l...
# javascript
r
How does one avoid minifying JS/CSS when running locally, while still doing so when building for production (i.e. running browserDevelopmentWebpack when local and browserProductionWebpack when production)? I find it hard to believe no one else has this need for fast turn around time locally while still maintaining minification etc. for production, and yet it is hard to find any information about it. (updated for clarity)
a
cc @Ilya Goncharov [JB]
i
browserDevelopmentWebpack
should not be minified like
browserDevelopment*Run*
, if you not set
mode
into
production
for all of these tasks Do you have
developmentWebpack
minified?
r
Sorry, I think my wording is a bit confusing.
browserDevelopmentWebpack
works as expected. It was more a question about possibility to toggle between
browserProductionWebpack
and
browserDevelopmentWebpack
depending on running locally or not. I updated my original message to hopefully be more clear.
c
That’s something that the Gradle tasks shouldn’t necessarily do on their own (how would it determine what’s “local” and what’s not?). It’s far easier to just have the developer set up their CI pipelines to use
browserProductionWebpack
and
browserDevelopmentWebpack
on their own machines during development.
If you’re using a build/deploy script, adding an environment variable or checking the common ones for your CI platform are an easy way to toggle this during the script