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

uniapp 如何在build:mp-weixin的时候,自动剔除掉用户中没有用到的图片资源 #5267

Closed
LBASD opened this issue Dec 24, 2024 · 3 comments

Comments

@LBASD
Copy link

LBASD commented Dec 24, 2024

No description provided.

@Otto-J
Copy link
Member

Otto-J commented Feb 25, 2025

实际上不需要额外操作。没有使用的图片是指什么,如果是 assets 目录,或者通过相对路径引用的,图片会正常处理。在 static 目录里会自动拷贝文件夹,你可以全局搜索 static 关键词。

@Otto-J Otto-J closed this as completed Feb 25, 2025
@LBASD
Copy link
Author

LBASD commented Feb 25, 2025

图片路径是动态的,无法自动删除。比如A项目用A项目对应的图片资源,B项目用B项目的图片资源。但我打包A项目时,是不回自动删除B项目的图片资源。而是所有资源一块打包。我现在的处理方案时,打包完成后,把除A项目以外的图片资源,通过脚本再删掉

@Otto-J
Copy link
Member

Otto-J commented Feb 25, 2025

不清楚两个项目如何组织的,明确你的用法吧,为什么要两个项目混合使用?你是多入口吗,还是 monorepo ?
这个需求反馈比较少,你可以使用 vite 插件的 buildEnd 脚本进行处理。

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

2 participants