-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support build cache #371
Conversation
Codecov Report
@@ Coverage Diff @@
## master #371 +/- ##
==========================================
+ Coverage 84.75% 84.87% +0.12%
==========================================
Files 11 12 +1
Lines 400 390 -10
Branches 119 119
==========================================
- Hits 339 331 -8
+ Misses 55 54 -1
+ Partials 6 5 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to locally test with different situations, Still changes by this PR might introduce some regressions. In that case please make an issue :)
Fix issues with nuxt build cache for
static
target.Related issues: #367, #352, #353
This PR mainly fixes #353
When using
nuxt generate
and cache hit happens, we skipnuxt build
step and directly generate. However asbuild:*
hooks won't be called anymore (even toughbuildModules
are called!)Attempts to fix
sw.js
is properly emitted (temporary fix)_build
flag exists (nuxt dev
,nuxt build
and first optional stage ofnuxt generate
) ortarget
isstatic
. Downside is we call modules twice when cache miss occurs but seems only waybuildModules
are called for generate's second stage builder is not loaded so webpack hook to emit assets andaddTemplate
does not workKnown issues
icon
Nuxt does not checks
static/
dir (static/icon.png
) for build cache. This means if icon is updated, module wasn't being called. By always running module this should be fixedmanifest
Relying on webpack hook means we can't generate updated manifest (in case icon hash changes)
meta
If meta depending on
process.env
, we won't regenerate it as ofaddTemplate
builder dependencyworkbox
sw.js
file needs to be restored. Instead of 491f440 workaround, we can directly generate template without depending on nuxt builder