Alias in css don't work ?
See original GitHub issueDescribe the bug
I’ve use alias but it seem not work in style
Reproduction
in vite.config.js
export default {
alias: { '/~/': require('path').resolve(__dirname, 'src') },
}
in App.vue
alias work in script
<script>
import { test } from '/~/Settings.js'
<script>
But don’t in style
<style>
@import '/~/css/Global.css'
</style>
System Info
- required
vite
version: v1.0.0-rc.3 - required Operating System: Linux
- required Node version: v12.11.1
- Optional:
- npm/yarn version 1.12.3
- Installed
vue
version (fromyarn.lock
orpackage-lock.json
) 3.0.0-rc.4 - Installed
@vue/compiler-sfc
version 3.0.0-rc.4
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:5 (2 by maintainers)
Top Results From Across the Web
how to alias class name in css or sass - Stack Overflow
There's no such thing as aliasing. Sass does have the @extend directive, but the solution isn't entirely obvious until you look into the ......
Read more >Webpack aliases not resolved in URLs in CSS properties
This works fine and everybody is happy. However, when I use a webpack alias module and import an URL using the ~ syntax,...
Read more >CSS antialiasing cheatsheet - Devhints
One-page guide to CSS antialiasing: usage, examples, and more. Here's a 4-line snippet on how to get beautiful, antialiased text with CSS.
Read more >font-smooth - CSS: Cascading Style Sheets - MDN Web Docs
The font-smooth CSS property controls the application of anti-aliasing when fonts are rendered.
Read more >8 Working With Global Selector Aliases - Oracle Help Center
The keyword :alias identifies your global selector alias as a CSS pseudo-class and serves as a syntax aid to organize the CSS code...
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
@oleksii-shaposhnikov you should ask questions in discord chat https://chat.vitejs.dev/ or at https://github.com/vitejs/vite/discussions instead of in old closed issues
@yyx990803 so how to import scss correctly like in the example in the description?