-
Notifications
You must be signed in to change notification settings - Fork 138
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
[Bug]: Static resources in the public directory cannot be accessed normally in the source code #3374
Labels
🐞 bug
Something isn't working
Comments
chenjiahan
changed the title
[Bug]: public目录下的静态资源在源代码中无法被正常访问
[Bug]: Static resources in the public directory cannot be accessed normally in the source code
Sep 4, 2024
Similar to this issue: facebook/create-react-app#9937 We will try to provide a solution for this |
rsbuild/core@^0.4.6 is work well but ^1.0.1-rc.5 can not work. I have a picture in: public/imgs/wms-0-params.png vue3 component: <template>
<div class="main-wrapper flex flex-1 flex-col">
<p>hello world</p>
<!-- NOTE work well -->
<img src="/imgs/wms-0-params.png" alt="" srcset="" />
</div>
</template>
<style lang="scss" scoped>
p {
color: red;
/* NOTE can not work Error: HookWebpackError: Cannot find module '/imgs/wms-0-params.png' */
background-image: url('/imgs/wms-0-params.png');
}
</style> This paractice is bad. And what's more it is a barrier for migration from vite. |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
Details
在目录
/public/assets/fonts/
下存放一个font.woff2
文件源代码css中注册该字体文件,css属性
src:url(/assets/fonts/font.woff2)
无法正常访问Reproduce link
无
Reproduce Steps
无
The text was updated successfully, but these errors were encountered: