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

app.cdnURL not applied to URLs in global CSS files #26895

Open
OpenSnack opened this issue Apr 23, 2024 · 1 comment
Open

app.cdnURL not applied to URLs in global CSS files #26895

OpenSnack opened this issue Apr 23, 2024 · 1 comment

Comments

@OpenSnack
Copy link

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: npm@10.2.3
  • Builder: -
  • User Config: app, devtools, css
  • Runtime Modules: -
  • Build Modules: -

Reproduction

3.11 repro

Compare with Nuxt 3.10: working repro

Describe the bug

Previously on 3.10, CSS files listed in the Nuxt config css property that have url('/...') in them would have those URLs automatically prefixed in the build step if app.cdnURL is set. The output entry-styles.[hash].mjs contained a line like this:

const main = "@font-face{font-family:Poppins;font-style:normal;font-weight:400;src:url(" + publicAssetsURL("pxiEyp8kv8JHgFVrJJfecg.woff2") + ")}*{font-family:Poppins}";

On 3.11, this step is skipped:

const main = "@font-face{font-family:Poppins;font-style:normal;font-weight:400;src:url(/pxiEyp8kv8JHgFVrJJfecg.woff2)}*{font-family:Poppins}";

The result is that our app doesn't find these files. It's possible that I should be using a different pattern, but I do know that 3.11 came with changes to public asset handling so I'm not sure if it's me or if it's related to that change.

Additional context

No response

Logs

No response

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

2 participants