Repository navigation
IOEXT-2183: fix: reload config after pre-app hooks and default --web-optimize from NODE_ENV (CEXT-6815) - #942
iivvaannxx wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@sandeep-paliwal, @iivvaannxx -- For someone who has added Same with |
|
@aroragarvit666-hue I get your point, but They are invoked automatically via the The |
|
@iivvaannxx we can add |
The reloads added after pre-app-build, pre-app-deploy, pre-app-run and pre-app-undeploy now run only when AIO_RELOAD_ENV_ON_HOOKS is set to a truthy value. Unset, empty, 0 and false skip the reload. The reload before rtLib.deployActions predates this branch and stays unconditional.
|
@sandeep-paliwal Done in |
Description
Two changes:
Reload config after every pre-app hook. Hooks can write to
.env, but onlyrunand the deploy-actions path reloaded config afterwards.aio-lib-core-configis now reloaded after:pre-app-buildinapp build, whichapp deployalso runsapp deploy, so DB auto-provisioning and the web deploy see the new valuespre-app-undeployinapp undeploypre-app-buildandpre-app-deployinsrc/lib/build-actions.jsandsrc/lib/deploy-actions.js, whichapp runuses when action files change--web-optimizedefaults fromNODE_ENV. The flag no longer defaults tofalse. When you don't pass it, the web build is optimized ifNODE_ENV=production. The value is read at build time, after thepre-app-buildreload, soNODE_ENVfrom.envis respected.--no-web-optimizeis now available to turn optimization off in production.Related Issue
IOEXT-2183 (blocks CEXT-6815)
Companion PR: adobe/aio-lib-web#248 (Parcel
modefromNODE_ENVin aio-lib-web)Motivation and Context
Values that pre-app hooks wrote to
.envwere ignored by later steps, and production web builds were never minified unless you passed the flag.How Has This Been Tested?
app/build,app/deploy,app/undeploy,app/run,lib/build-actions,lib/deploy-actions) pass: 206 tests, 10 of them new. The new tests check that the reload happens after the pre-hook and before the next step, and cover each--web-optimize/NODE_ENVcombination.eslint src testis clean.npm installof current master, 107 unrelated tests fail locally both with and without this change.Types of changes
Checklist:
oclif readmeon version)