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

How to work with 'public' folder? #110

Open
IvankoBoichuk opened this issue Nov 6, 2024 · 1 comment
Open

How to work with 'public' folder? #110

IvankoBoichuk opened this issue Nov 6, 2024 · 1 comment

Comments

@IvankoBoichuk
Copy link

IvankoBoichuk commented Nov 6, 2024

Hi, thanks for your plugins.
I have a problem when I use the folder with static files:

Examples:

@font-face {
    font-family: 'Codec Pro';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/CodecPro-Regular.woff2") format('woff2'), url("/fonts/CodecPro-Regular.woff") format('woff');
  }

<section id="for-whom" class="bg-[url(/bg-for-who.jpg)] lg:bg-[url(/bg-for-who-lg.jpg)]"/></section>

When it runs npm run build works perfectly, but if npm run dev I'm getting 404 errors in the console:
GET http://localhost:10095/bg-for-who.jpg 404 (Not Found)
GET http://localhost:10095/bg-for-who-lg.jpg 404 (Not Found)
GET http://localhost:10095//fonts/CodecPro-Regular.woff 404 (Not Found)

http://localhost:10095/ - PHP Servers URL

@IvankoBoichuk IvankoBoichuk changed the title How to work with public folder? How to work with 'public' folder? Nov 6, 2024
@double-hash
Copy link

Hello

May be try to use complete file path format in your CSS, like :
url("./wp-content/themes/your-theme/public/fonts/CodecPro-Regular.woff2")
if you are developing a theme.

This is the only solution I found at the moment, but I don't really know if it's the best

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