Cameron Probert
07/27/2022, 8:03 AMbuild
, browserDevelopmentWebpack
and browserProductionWebpack
, and also how they differ from setting the webpack mode to PRODUCTION
or DEVELOPMENT
in build.gradle.kts
.
I ask this because I was using browserDevelopmentWebpack
but with mode=PRODUCTION
, which seem like they would conflict with each other, and the resulting bundle appeared to be a development bundle (not minified, not DCE’d).andylamax
07/27/2022, 8:24 AMbuild.gradle.kts
. However, even if you can. My advice will just be don't.
Why?
you already have gradle tasks at hand. You need a production build, you just run browserProductionWebpack
, you need a development build, you run the alternative.
Differences you ask.
In the JS world, normally javascript is shipped uglified & minified to reduce bundle size. While this is desirable for production builds, it is not during development. You still need to be able to inspect your code and see what the variable name is not really worrying about size.
So, to summurize,
browserProductionWebpack
will first assemble all your dependencies, eliminate dead code, and then proceed to minify your compiled javascript. while browserDevelopmentWebpack
will just assemble all your dependencies and serve them unminified. Resulting to faster responses compared to browserProductionWebpack
Cameron Probert
07/27/2022, 8:28 AMmode
. And how does build
differ from browserProductionWebpack
? I had been using build
to generate my deployable code but I’m thinking browserProductionWebpack
is all I need.andylamax
07/27/2022, 8:34 AMbuild
does more than just invoking browserProductionWebpack
, it also runs checks and tests. And yes, provided that you are in confidence to deploy, browserProductionWebpack
is the task you are looking forCameron Probert
07/27/2022, 8:35 AMBig Chungus
07/27/2022, 8:40 AMBig Chungus
07/27/2022, 8:40 AMCheick Kante
12/15/2022, 9:08 PM