vite build very slow #15740
Replies: 5 comments 2 replies
-
facing the same issue, for every save it takes upto 20 seconds build the app and render the app again |
Beta Was this translation helpful? Give feedback.
-
I think it would be good to try to remove plugins to see which ones are taking so much time. You can also use |
Beta Was this translation helpful? Give feedback.
-
你有找到解决方案吗? |
Beta Was this translation helpful? Give feedback.
-
update the @vitejs/plugin-legacy can winding build of speed |
Beta Was this translation helpful? Give feedback.
-
vite-plugin-svg-icons 每一个 transform 都会 load 一次,调用一次fs.glob查找所有svg,该io操作在windows中很慢。可以在 node_module/vite-plugin-svg-icons/dist/index.mjs 中做如下修改,来测试是否有改进。 let svgFilsStats = null <--- add this line
async function compilerIcons(cache, svgOptions, options) {
const { iconDirs } = options;
let insertHtml = "";
const idSet = /* @__PURE__ */ new Set();
for (const dir of iconDirs) {
svgFilsStats ??= fg.sync("**/*.svg", { <--- change this line
cwd: dir,
stats: true,
absolute: true
}); 建议换一个svg图标库。 Every time a let svgFilsStats = null <--- add this line
async function compilerIcons(cache, svgOptions, options) {
const { iconDirs } = options;
let insertHtml = "";
const idSet = /* @__PURE__ */ new Set();
for (const dir of iconDirs) {
svgFilsStats ??= fg.sync("**/*.svg", { <--- change this line
cwd: dir,
stats: true,
absolute: true
}); You should change to another library. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
when i build, in transforming is very slow
it use More than 2 minutes.
Is there any way to optimize it?
Steps to reproduce
this is my vite config
System Info
Used Package Manager
pnpm
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions