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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expose vite's default manualChunks function #5585
Conversation
@@ -2,6 +2,8 @@ import path from 'path' | |||
import { defineConfig } from 'vite' | |||
import vuePlugin from '@vitejs/plugin-vue' | |||
import { vueI18nPlugin } from './CustomBlockPlugin' | |||
import { createMoveToVendorChunkFn } from 'vite' | |||
const viteChunks = createMoveToVendorChunkFn() |
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.
The cache is not going to be cleaned up correctly during build watch if it is defined in this way. I think we are having an issue in Vite here, no? This cache should be cleaned in buildStart
. Maybe we should move it out of the function, and into the plugin control.
Maybe we could end up exposing a single function instead of factory afterwards?
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.
Re-analyzed the building logic, the problem does exist, I will push a new commit for review : )
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.
Please focus on checking whether it needs to be cleared here?
b9f1826#diff-aa53520bfd53e6c24220c44494457cc66370fd2bee513c15f9be7eb537a363e7R564-R565
Will the parallelCallCounts
introduced by 4a955bc actually be greater than 1? I tested several scenarios that I expected and found nothing. If it is greater than, maybe parallel build will affect the shared cache?
Open a new thread below for tracking.
// clear cache for parallel builds | ||
cacheVendorChunks.clear() |
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.
Please focus on checking whether it needs to be cleared here?
Will the parallelCallCounts introduced by 4a955bc actually be greater than 1? I tested several scenarios that I expected and found nothing. If it is greater than, maybe parallel build will affect the shared cache?
Description
fix: #5487
createMoveToVendorChunkFn
so that users can reuse it in custommanualChunks
.manualChunks
, and thevendor.hash.js
will always output. Maybe we can add an option to turn it on or off, thinking we need to discuss 馃Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).