在Visual Studio代码中,IDE如何使用app-module-path识别types
我正在使用app-module-path的节点环境中,以便始终可以从基本path写入require。
所以所有的path可以是: const something = require('/api/something')
而不必像下面这样退出文件夹结构: const something = require('../../api/something)
。
没有确切的path,VSCode说,所有types都是任何types的。 这意味着像“去定义”这样的function是行不通的。
有没有办法configurationVSCode来解决这个问题?
经过一些更多的search,我发现这可以通过使用jsconfig.son文件使用以下设置来完成。
{ "compilerOptions": { "target": "ES6", "allowSyntheticDefaultImports": true, "jsx": "react", "module": "commonjs", "baseUrl": ".", "paths": { "*": [ "*", "app/*" ] } }, "include": [ "app/**/*.js" ] }
- 在aws elastic-beanstalk上configurationhttps进行快速configuration
- mongoose:错误找不到模块debugging
- NodeJS上的SSL证书,并表示不工作
- 在nodejs scrypt包中使用Firebase SCrypt params
- 使用NSSM作为Windows服务启动NodeJs进程不起作用
- Sequelizevalidation不工作保存()
- websocket + node.js +回退框架
- 如何编写将在Chrome和Node.js中运行的JavaScript Web代码?
- 在.NET中使用C#可以在没有multithreading的情况下实现基于事件的asynchronous模式吗?