-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Vite does not resolve css url() paths correctly #19058
Comments
Hello @DennisGarding. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Here is the simple repository. For installation, read the README. https://github.com/DennisGarding/viteConfigReproduction Is that enough? |
I don't see any problem with this build output as same as #18398. |
You can set |
Ok, that works. Thank you |
Describe the bug
Older issue: #18398
I have the same problem. The browser can not load the font. If i add a dot before the slash or remove the slash, it works
My build config
build: { outDir: fileURLToPath(new URL('./../public/admin', import.meta.url)), target: 'esnext', manifest: true, emptyOutDir: true, minify: true, rollupOptions: { input: fileURLToPath(new URL('./src/main.ts', import.meta.url)), output: { entryFileNames: '[name].js', chunkFileNames: '[name]-[hash].js', assetFileNames: '[name].[ext]', globals: { vue: 'Vue' } } } },
The output
@font-face{ font-display:block; font-family:bootstrap-icons; src:url(/bootstrap-icons.woff2) format("woff2"),url(/bootstrap-icons.woff) format("woff") }
Used in App.vue style
<style> @import "./../node_modules/bootstrap-icons/font/bootstrap-icons.css"; @import "./../node_modules/bootstrap/dist/css/bootstrap.min.css"; ... ...
Reproduction
aaa
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: