I would like to create aliases for some directories in a Nuxt 3 project, however, I was not able to make them work just from the information provided in the documentation.
I've tried registering them like this:
export default defineNuxtConfig({ alias {"@scss": "/<rootDir>/assets/scss", }})
as well as like this:
import {fileURLToPath} from "url";export default defineNuxtConfig({ alias {"@scss": fileURLToPath(new URL('./assets/scss', import.meta.url)), }})
and then using them in vue components like this:
<style lang="scss">@use "~@sass/............"; // one way (because the documentation says sth about prefixing it with '~'@use "@sass/............";</style>
and as you can probably imagine, it did not work 😅.
What is the proper way to register an alias for a folder and then use it in css, javascript & template markup?