問題描述當(dāng)我使用別名的方式引用文件時,控制臺會輸出index.ts:1:16 - error TS2307: Cannot find module '@/test.js'.相關(guān)代碼/project/test.jsexport default function () { console.log('josh');
}/config.json{ "compilerOptions": { "baseUrl": ".", "rootDir": ".", "paths": { "@/*": ["project/*"]
}, "module": "esnext", "target": "es6", "lib": ["esnext", "dom"], "moduleResolution": "node", "experimentalDecorators": true, "resolveJsonModule": true, "pretty": true
}, "exclude": ["node_modules", "dist"]
}/index.jsimport fn from '@/test';
fn();關(guān)注 | 2收藏
typescript無法使用別名的方式引入文件
紅糖糍粑
2019-03-10 14:42:55