Visual Studio代码错误地抱怨没有找到模块

时间:2017-10-25 12:37:49

标签: vue.js visual-studio-code

从Vue 2.0升级到Vue 2.5后,Visual Studio Code抱怨没有找到模块。但是在使用Webpack进行编译时,会发现并编译模块!此外,模块可以从.vue文件中找到,而不是来自index.ts

index.ts

import App from './components/app.vue'  // VS Code can't find module
                                           but webpack still compiles it

app.vue

import Card from "./card.vue"  // VS Code does find module 

我的目录结构

src
-index.ts
-components
---app.vue
---card.vue

tsconfig.json

{
    "compilerOptions": {
        "outDir": "./dist/",
        "module": "es2015",
        "moduleResolution": "node",
        "target": "es2015",
        "lib": ["dom","es5","es2015.promise"]
    },
    "include": [
        "./src/**/*"
    ]
}

0 个答案:

没有答案