Aliasing paths can be a really handy way of referencing key directories in your project within deeply nested files. For example, take a look at the...
For further actions, you may consider blocking this person and/or reporting abuse
Worked perfectly! Thanks for sharing! 😎
Finally got it working. Thank you
Great instructions! Thanks man.
Thank you so much, it was really helpful 😁🙌
After one whole day of testing many sets of configurations, finally you helped me, Thank you
Didn't work for me, this did: stackoverflow.com/questions/660436...
Thanks a lot bro
I created an account just to say thank you
I am trying to do so but didn't worked. I am using JavaScript, instead of Typescript.
vite.config.json
and
package.json
Imported as
import Header from "@components/Header";
Also, I had installed
@types/node
as per the instructions.But still receiving this error
Please Help!
As you're not using TypeScript, you should create a file named jsconfig.json in the root folder of your app and put the config there, something like this:
{
"compilerOptions": {
"baseUrl": ".",
"target": "es6",
"paths": {
"@/*": "src/*",
"@components/*": "src/components/*",
"@assets/*": "src/assets/*"
}
},
"exclude": ["node_modules"]
}
Thank you for the reply. I have figured out the solution here... stackoverflow.com/questions/777661...
Is there an option to use these alias in
path
parameter of a function? I would like to use in afs.readdirSync
to not enter the whole pathHi, do I need to install "path" package..? It doesn't come with a new react-typescript vite template.
If you're using Node as your runtime, you don't need to.
path
is one of Node's built-in modules.