我可以毫無問題地將模塊解析器與 Javascript 一起使用。實際上,我可以在運行時毫無問題地將它與 Typescript 一起使用,但在開發(fā)部分我找不到Cannot find module or its corresponding type declerations問題的解決方案。我正在尋找答案我做錯了哪一部分?以下是文件:.babelrc{ "presets": ["module:metro-react-native-babel-preset"], "plugins": [ [ "module-resolver", { "root": ["./src"], "alias": [ { "@shared-components": "./shared/components" }, { "@shared-constants": "./shared/constants" }, { "@shared-theme": "./shared/theme" }, { "@font-size": "./shared/theme/font-size" }, { "@api": "./services/api/index" }, { "@fonts": "./shared/theme/fonts/index" }, { "@colors": "./shared/theme/colors" }, { "@theme": "./shared/theme/index" }, { "@services": "./services" }, { "@screens": "./screens" }, { "@utils": "./utils/" }, { "@assets": "./assets/" } ], "extensions": [".js", ".jsx", ".ts", ".tsx"] } ] ]}tsconfig.json文件{ "compilerOptions": { "target": "esnext", "module": "esnext", "lib": ["esnext"], "allowJs": true, "jsx": "react-native", "noEmit": true, "isolatedModules": true, "strict": true, "moduleResolution": "node", "allowSyntheticDefaultImports": true, "esModuleInterop": true, // ? Custom ones "skipLibCheck": true, "resolveJsonModule": true, "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, "noImplicitThis": true, "alwaysStrict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "forceConsistentCasingInFileNames": true, // ? Babel Plugin Module Resolver
React Native Typescript babel-plugin-module
FFIVE
2023-06-15 16:38:38