Solution:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
build: {
rollupOptions: {
output: {
//Solve Warning: Some chunks are larger
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
}
}
}
}
})
Read More:
- [Solved] Vite packing error: some chunks are larger than 500kb after minification
- [Solved] vite package Error: globalThis is not defined
- [Solved] react-router-dom Error: index.js:1 Warning: Functions are not valid as a React child.
- After Vite starts, it will prompt “network: use ` — host ` to expose”, and the service cannot be accessed through network IP
- [Solved] vite2+vue3 jsx Error: React is not defined
- Vue3 + vite install element-plus error [How to Solve]
- [Solved] Temporary error: Error: spawn E:\vue3-vite\my-app\node_modules\esbuild\esbuild.exe ENOENT
- [Solved] arco design vite-plugin-style-import Load menu-item error: Internal server error…
- Vue-cli2 sub environment packaging
- How to Solve Vite package error
- [Solved] vue3vite Error: Failed to resolve import “@vue/server-renderer from “src\App.vue“. Does the file exist
- [Solved] Vue-cli3 running or packaging error: JS memory overflow
- Method of identifying vite alias path by idea webstorm
- Vue item packaging error: errno 134 [How to Solve]
- [Solved] Vite Error: Failed to load module script: Expected a JavaScript module script but the server…
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- [Solved] Error:Plugin/Preset files are not allowed to export objects, only functions
- Solution to some map files in JS folder after Vue packaging (remove the map. JS file)
- “Failed to load resource: net::ERR_FILE_NOT_FOUND” error. The project created by vue-cli 3.0 can run under dev, and an error is reported after packaging, and the page is blank.
- [Solved] error when starting dev server:Error: The following dependencies are imported but could not be reso