-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
[Build] Prevent /server/assets creation in Vike V1 #2093
Comments
Up for a PR? See |
Yes |
@brillout by default, Removing the code vike/vike/node/plugin/plugins/buildConfig.ts Lines 68 to 78 in 30f5a91
the /dist/server/assets aren't generated.The user can set vite.build.ssrEmitAssets to true if needed (I'm tested and it works).
So can we remove the vike/node/plugin/plugins/buildConfig/fixServerAssets.ts implementation because |
Created #2095 |
Description
With Vike design V0,
/dist/server/assets
files aren't bundled, while with V1 one they are bundled.The bundle logic for Vike V1 was fixed in #2034 where
/dist/server/assets/*
files are created during the build and then removed.The
/dist/server/assets
should not be bundled with Vike design V1 as V0 one.Informations
Vike design V0
Run
yarn build
on vike-with-vercel#vike-design-v0Build logs:
Vike design V1
Run
yarn build
on vike-with-vercel#vike-design-v1Build logs:
On some project with Vike design V1, after many builds, I get the EPERM error:
Solution
During the build step, prevent the creation of
/dist/server/assets
files.Maybe using thegenerateBundle
vite plugin hook, theassets/*
keys can be removed frombundle
object (second parameter ofgenerateBundle
).By default, in the Vike design V1, the fix server assets is enabled (
vite.build.ssrEmitAssets = true
) that generates dupe assets in/dist/server/assets
:vike/vike/node/plugin/plugins/buildConfig.ts
Line 72 in 6cd356e
In the Vike design V1, there is any sense to generate the server assets with the fix server assets (
vite.build.ssrEmitAssets = true
) logic and the remove them.Simply, in the Vike design V1, remove the fix server assets (
vite.build.ssrEmitAssets = true
) logic and the user, if he needs the/dist/server/assets
, can addvite.build.ssrEmitAssets = true
in thevite.config
.Related
cssCodeSplit
leads to duplicated CSS #1993The text was updated successfully, but these errors were encountered: