Next.js Discord

Discord Forum

help with paths in sass files

Unanswered
Raspberry Horntail posted this in #help-forum
Open in Discord
Raspberry HorntailOP
@use "@styles/functions/functions.scss" as func;

i am uses path aliases in tsconfig
"@styles/*": ["./src/styles/*"],

if i am alt+click to path
"@styles/functions/functions.scss"
it redirect me to a wrong address in files
but functions and all is working

5 Replies

@Raspberry Horntail @use "@styles/functions/functions.scss" as func; i am uses path aliases in tsconfig "@styles/*": ["./src/styles/*"], if i am alt+click to path "@styles/functions/functions.scss" it redirect me to a wrong address in files but functions and all is working
if you have @styles/* as ./src/styles/*, then @styles/functions/functions.scss will redirect you to ./src/styles/functions/functions.scss, what is the path you want to achieve
@Coffee Coke if you have `@styles/*` as `./src/styles/*`, then `@styles/functions/functions.scss` will redirect you to `./src/styles/functions/functions.scss`, what is the path you want to achieve
Raspberry HorntailOP
@use "@styles/functions/functions.scss"
"paths": {
"@/": ["./src/"],
"@app/": ["./src/app/"],
"@components/": ["./src/components/"],
"@styles/": ["./src/styles/"],

"@layout/": ["./src/layout/"],
"@hooks/": ["./src/hooks/"],
"@pages/": ["./src/pages/"],
"@types/": ["./src/types/"],
"@helpers/": ["./src/helpers/"],
"@lib/": ["./src/lib/"],
"@fonts/": ["./src/fonts/"]
}
i writing alias as you write but it scss it redirect me wrong
@Coffee Coke instead of writing so many paths, just write one: `"@/src/*": ["./src/*"]` you will get the same results and also you havent written as I did
Raspberry HorntailOP
dude my code is working it's just no intelsense inside this imports and i want to find a way to fixed this in vscode
@Coffee Coke instead of writing so many paths, just write one: `"@/src/*": ["./src/*"]` you will get the same results and also you havent written as I did
Raspberry HorntailOP
no scss variables func names inside this, it's very crutial, i i am doing relative syntax it's all working how can i achieve that:? within visual studio code next/js