Open dum3ng opened 4 years ago
ts-node
tsconfig.json
当使用ts-node的时候, module 应该选为commonjs
module
commonjs
{ "compilerOptions": { "module": "commonjs" } }
如果引入了如 scss,md, yml等类型的文件,那么ts可能会报错:
can not find module `path/to/file`
这时,添加声明文件即可:
// @filename: app.d.ts declare module '*.yml' { const content: any export default content } declare module '*.scss' { const content: string export default content }
qs
use
ts-node
withtsconfig.json
当使用ts-node的时候,
module
应该选为commonjs
can not find module
如果引入了如 scss,md, yml等类型的文件,那么ts可能会报错:
这时,添加声明文件即可:
references