-
Notifications
You must be signed in to change notification settings - Fork 113
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
Comments
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> |
mark |
这样子用能封装插件吗? |
我把插件剔除了, 用了我上面的方法。 |
这种方式在运行时才会导入,打包的时候也会把图标全部打进去吧? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我去除了之后,打包速度从 4min -> 36s.....
The text was updated successfully, but these errors were encountered: