assets in css include '__NUXT_BASE__' prefix in production build
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v17.3.1
- Nuxt Version:
3.0.0-27375427.d07d572
- Package Manager:
yarn@3.2.0-rc.10
- Bundler:
Vite
- User Config:
publicRuntimeConfig
,privateRuntimeConfig
,buildModules
,css
,vite
,unocss
- Runtime Modules:
-
- Build Modules:
@vueuse/nuxt@7.5.3
,unplugin-icons/nuxt
,@unocss/nuxt@0.22.4
Reproduction
…
Describe the bug
I suspect this may be related to #2655.
It only affects yarn build
.
@font-face {
font-family: "SpaceGroteskLight";
src: url("assets/fonts/SpaceGrotesk-Light.ttf");
font-display: swap;
}
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:23 (4 by maintainers)
Top Results From Across the Web
Assets directory
The assets directory contains your un-compiled assets such as Stylus or Sass files, images, or fonts.
Read more >The build Property
The build property. Nuxt lets you customize the webpack configuration for building your web application as you want. analyze. Nuxt use webpack-bundle- ...
Read more >Static directory
The static directory is directly mapped to the server root () and contains files that likely won't be changed. All included files will...
Read more >Configuration
Nuxt lets you define the CSS files/modules/libraries you want to set globally (included in every page). In case you want to use sass...
Read more >The css Property
Nuxt lets you define the CSS files/modules/libraries you want to set globally (included in every page). In case you want to use sass...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve updated the CodeSandBox reproduction I made for #2261 to include a font example: https://codesandbox.io/s/nuxt-3-missing-images-and-font-prod-3-0-0-27375427-d07d572-3cpwz
I also had the problem with fonts in css and could fix it by setting the base path for the vite config.
Found it here https://github.com/nuxt/framework/blob/c80870ad8c4a1c1b044d7a5ae27e41e997f8a75f/packages/vite/src/vite.ts#L53