TypeScript Version: 2.4.0
Code
import * as Vue from "vue";
console.log(Vue);
{
"compilerOptions": {
"target": "es5",
"module": "esnext"
}
}
Expected behavior:
no error.
Actual behavior:
error TS2307: Cannot find module 'vue'.
Reference 1 of js file with same source code:
Result: works fine with webpack.
Reference 2 of with same source code and this tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs"
}
}
Result: no compilation error, and works fine with webpack.
TypeScript Version: 2.4.0
Code
{ "compilerOptions": { "target": "es5", "module": "esnext" } }Expected behavior:
no error.
Actual behavior:
error TS2307: Cannot find module 'vue'.
Reference 1 of js file with same source code:
Result: works fine with webpack.
Reference 2 of with same source code and this tsconfig.json:
{ "compilerOptions": { "target": "es5", "module": "commonjs" } }Result: no compilation error, and works fine with webpack.