Closed Mister-Hope closed 1 year ago
Let's postpone until node 14 EOL
This pr remain node 14 support, with the latest vite4.3. @meteorlxy You can merge this now.
Some updates, it works fine here, but the solution is not working downstream in my repo.
When we set manualChunks
option with file path based modules, vite@4.3 totally stop spliting chunks according to import()
when the imported package has deps that is "chunk spliting" manually with the option.
An example is @vue/repl
that vuepress-plugin-md-enhance
is using. Since we are adding tree-shaking support for this module, the plugin is generating a file at temp folder and use it as clientConfig file, so that @vue/repl
would not be imported and analyzed if user does not enable vue playground feature.
The official vue playground has vue
and vue/complier
(or @vue/compiler-sfc
) as deps, while I delete all related code inside manualChunks, the import('@vue/repl')
can result a assets/vue-repl-[hash].js
chunk which is 4.3Mb large.
However, if we manually set any related deps that @vue/repl
needs (e.g.: vue
, @vue/shared
), the chunk is no longer generated, instead it appears in app,[hash].js
entry file.
@meteorlxy Any suggestions here?
@Mister-Hope I'd suggest to revert vite to 4.2 in the PR. Let's do other deps' updates and node version bump first. Then upgrade vite to 4.3 in another PR
This PR contains: