把微信小游戏的api定义文件放到node_modules/@types中, 项目中的无法识别wx关键字.请问3.1支持node_modules/@types么?
整个不是 Creator 支持的,Creator 是不理会所有 .d.ts
文件的。
你可以把 .d.ts 放到项目里面,然后用 VSCODE 看看有没有。
确实不能识别@type, 需要在tsconfig.json中手动增加:
{
/* Base configuration. Do not edit this field. */
"extends": "./temp/tsconfig.cocos.json",
/* Add your custom configuration here. */
"compilerOptions": {
"strict": false,
"types": ["./node_modules/@types/minigame-api-typings/index"]
}
}