Skip to content
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

这插件导致项目打包慢了6倍。。。 #112

Open
zhoufanglu opened this issue Aug 23, 2024 · 4 comments
Open

这插件导致项目打包慢了6倍。。。 #112

zhoufanglu opened this issue Aug 23, 2024 · 4 comments

Comments

@zhoufanglu
Copy link

我去除了之后,打包速度从 4min -> 36s.....

@zhoufanglu
Copy link
Author

vite环境下这样动态引入svg就行,插件已经剔除

const icon = ref();

const getPath = async () => {
  const path = `你的本地路径`;

  const { default: svg } = await import(path + "?raw");
  icon.value = svg;
};
getPath();
<template>
  <i :style="iconStyle" v-html="icon" v-if="icon"></i>
</template>

@HealerLu
Copy link

mark

@SunSeekerX
Copy link

这样子用能封装插件吗?

@zhoufanglu
Copy link
Author

这样子用能封装插件吗?

我把插件剔除了, 用了我上面的方法。
这插件导致打包速度变慢。。不用了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants