Answer the question
In order to leave comments, you need to log in
How to set windows and phpstrom to work with paths like '@/...'?
In a nuxt project, I use the following paths to import components:
components: {
ContainerElement: () => import("@/components/grid/ContainerElement"),
Answer the question
In order to leave comments, you need to log in
Create jsconfig and/or tsconfig file with aliases
// jsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/common/*": [
"../src/common/*"
],
"@/components/*": [
"../src/common/components/*"
],
"@/utils/*": [
"../src/common/utils/*"
],
"@/modules/*": [
"../src/modules/*"
]
}
}
}
/ tsconfig.json
{
"extends": "../tsconfig.json",
"include": [
"./**/*.ts*"
],
"exclude": [],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/common/*": [
"../src/common/*"
],
"@/components/*": [
"../src/common/components/*"
],
"@/utils/*": [
"../src/common/utils/*"
],
"@/modules/*": [
"../src/modules/*"
]
},
"types": [
"cypress"
],
"sourceMap": false,
"isolatedModules": true
}
}
System.config({
"paths": {
"components/*": "./src/components/*",
"core/*": "./src/core/*",
// алиасы и тд
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question