vite type check: generated moduleSuffixes override the project's chain
Summary
The typescriptCheckPlugin added in #11450 generates a scratch tsconfig that sets compilerOptions.moduleSuffixes to a fixed ['.<platform>', '.native', ''] (from getModuleSuffixes() in helpers/typescript-check.js). This overrides the project's own moduleSuffixes chain instead of extending it, so files carrying custom suffix tiers — e.g. a shared-mobile .mobile tier that app code and third-party libraries use between the OS qualifier and the unsuffixed default — fail the build-time type check with TS2307 even though the same imports resolve in the app's own tsconfig and at bundle time via resolve.extensions.
Reproduction
// shared/use-thing.ts
import { thing } from './Thing' // Thing.mobile.ts exists// app tsconfig
{ "compilerOptions": { "moduleSuffixes": [".ios", ".android", ".mobile", ""] } }ns build ios --env.typecheck reports Cannot find module './Thing'; tsc -p tsconfig.json is clean.
Suggested fix
Either:
- merge the project's
moduleSuffixeswith the generated ones (project chain takes precedence, or append the generated entries), or - derive the generated chain from the project's
moduleSuffixesdirectly — the scratch config alreadyextendsthe project tsconfig, so simply dropping the override when the project declaresmoduleSuffixeswould work.
Happy to send a PR if either direction sounds right.
Source: NativeScript/NativeScript