diff --git a/package.json b/package.json index 263cbe8..3a98797 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "esbuild-jest": "npm:@alloc/esbuild-jest@^0.3.6", "jest": "^26.6.3", "klona": "^2.0.4", - "prettier": "^2.0.5", + "prettier": "^2.8.7", "rollup": "^2.45.2", "tsup": "^6.5.0", "typescript": "^4.9.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d1e1df7..548e04c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,7 +15,7 @@ importers: globrex: ^0.1.2 jest: ^26.6.3 klona: ^2.0.4 - prettier: ^2.0.5 + prettier: ^2.8.7 rollup: ^2.45.2 tsconfck: ^2.1.0 tsup: ^6.5.0 @@ -36,7 +36,7 @@ importers: esbuild-jest: /@alloc/esbuild-jest/0.3.6_esbuild@0.11.23 jest: 26.6.3 klona: 2.0.4 - prettier: 2.4.1 + prettier: 2.8.7 rollup: 2.58.0 tsup: 6.5.0_typescript@4.9.3 typescript: 4.9.3 @@ -4031,8 +4031,8 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier/2.4.1: - resolution: {integrity: sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==} + /prettier/2.8.7: + resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==} engines: {node: '>=10.13.0'} hasBin: true dev: true diff --git a/src/index.ts b/src/index.ts index f37ce95..af689a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,18 +76,33 @@ export default (opts: PluginOptions = {}): Plugin => { } } + const parseOptions = { + resolveWithEmptyIfConfigNotFound: true, + } satisfies import('tsconfck').TSConfckParseOptions + const parsedProjects = new Set( - await Promise.all( - projects.map((tsconfigFile) => - hasTypeScriptDep - ? tsconfck.parseNative(tsconfigFile) - : tsconfck.parse(tsconfigFile) + ( + await Promise.all( + projects.map((tsconfigFile) => + hasTypeScriptDep + ? tsconfck.parseNative(tsconfigFile, parseOptions) + : tsconfck.parse(tsconfigFile, parseOptions) + ) ) - ) + ).filter((project, i) => { + if (project.tsconfigFile !== 'no_tsconfig_file_found') { + return true + } + debug('tsconfig file not found:', projects[i]) + return false + }) ) resolversByDir = {} parsedProjects.forEach((project) => { + if (!project) { + return + } // Don't create a resolver for projects with a references array. // Instead, create a resolver for each project in that array. if (project.referenced) {