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

public 和 assets 目录的区别 #89

Open
nmsn opened this issue Apr 20, 2023 · 1 comment
Open

public 和 assets 目录的区别 #89

nmsn opened this issue Apr 20, 2023 · 1 comment

Comments

@nmsn
Copy link
Owner

nmsn commented Apr 20, 2023

一般项目中存在 public 和 assets,通常都是用来放静态资源的,他们有什么区别?

@nmsn
Copy link
Owner Author

nmsn commented Apr 20, 2023

public 文件夹下的图片等静态资源,不经过打包工具的处理,直接复制到产物目录下,且使用需要通过绝对路径引用 public/img.png

assets 文件夹下的图片等静态资源,会被当作模块依赖,会经过打包工具的处理,通过相对路径引用

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

No branches or pull requests

1 participant