admin管理员组文章数量:1355703
I have added a jsconfig.json
in the root of my javascript project to try and exclude some build files as well as set some path mappings but nothing seems to happen. Part of the problem is that I'm not sure what the expected oute is when using a jsconfig.json
, I've read the documentation for it but it does not demonstrate any of the results.
Can someone provide me with a small and working jsconfig.json
with a description of what it actually does? So that I can use it to verify that it actually works in my project as well.
Or, does someone know of a way to verify that a jsconfig.json
is working/picked up by VS Code?
I have added a jsconfig.json
in the root of my javascript project to try and exclude some build files as well as set some path mappings but nothing seems to happen. Part of the problem is that I'm not sure what the expected oute is when using a jsconfig.json
, I've read the documentation for it but it does not demonstrate any of the results.
Can someone provide me with a small and working jsconfig.json
with a description of what it actually does? So that I can use it to verify that it actually works in my project as well.
Or, does someone know of a way to verify that a jsconfig.json
is working/picked up by VS Code?
- You wrote, "but nothing seems to happen." What are you expecting to happen? – Shaun Luttin Commented May 8, 2017 at 17:07
-
1
@shaun-luttin For the
exclude
property I was hoping it would exclude files and folders from the Explorer view as well as be ignored by intellisense. As for the path mapping I was hoping it would resolve (for intellisense) some custom import statements in the project. – Karl Thunberg Commented May 8, 2017 at 17:57
1 Answer
Reset to default 6In my project i was using jsconfig.json file for accesss the file imports directly from the ./src directory from wherever i am trying to import.
My jsconfig.json looks like:
{
"pilerOptions": {
"baseUrl": "./src"
},
"include": [
"src"
]
}
include:
If no include attribute is present, then this defaults to including all files in the containing directory and subdirectories. When a include attribute is specified, only those files are included
baseUrl:
This gives the base directory for the file import path
this is my project structure where i have used jsconfig.json
so if i need to import a function from src/util/auth_util.js
inside src/ponent/Login/index.js
inside src/ponent/Login/index.js
src/ponent/Login/index.js :
import { userLogin } from 'util/auth_util.js'
import statement if jsconfig.json as mentioned above not used
src/ponent/Login/index.js :
import { userLogin } from '../../util/auth_util.js'
本文标签: javascriptIs my jsconfigjson not working in Visual Studio CodeStack Overflow
版权声明:本文标题:javascript - Is my jsconfig.json not working in Visual Studio Code? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743998695a2573461.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论