Skip to content

Commit

Permalink
Move the file copying over to earlier in the process
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed May 2, 2024
1 parent a748268 commit 9d90c4c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/astro/src/core/build/plugins/plugin-content.ts
Expand Up @@ -153,6 +153,11 @@ function vitePluginContent(
await copyFiles(cached, dist, true);
}
}
// Copy over the content cache now so that new files override it
const cacheExists = fsMod.existsSync(contentCacheDir);
if (cacheExists) {
await copyFiles(contentCacheDir, distContentRoot, false);
}
}

// If nothing needs to be rebuilt, we inject a fake entrypoint to appease Rollup
Expand Down Expand Up @@ -264,9 +269,6 @@ function vitePluginContent(
await fsMod.promises.writeFile(contentManifestFile, JSON.stringify(newManifest), {
encoding: 'utf8',
});
if (cacheExists && currentManifestState === 'valid') {
await copyFiles(contentCacheDir, distContentRoot, false);
}
},
};
}
Expand Down

0 comments on commit 9d90c4c

Please sign in to comment.