vite-tsconfig-paths
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -181,8 +181,10 @@ "use strict"; | ||
function createResolver(project) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
const configPath = project.tsconfigFile; | ||
const config = project.tsconfig; | ||
debug("config loaded:", (0, import_util.inspect)({ configPath, config }, false, 10, true)); | ||
if (((_a = config.files) == null ? void 0 : _a.length) == 0) { | ||
debug(`[!] files array is empty: "${configPath}"`); | ||
if (((_a = config.files) == null ? void 0 : _a.length) == 0 && !((_b = config.include) == null ? void 0 : _b.length)) { | ||
debug( | ||
`[!] skipping "${configPath}" as no files can be matched since "files" is empty and "include" is missing or empty` | ||
); | ||
return null; | ||
@@ -201,3 +203,3 @@ } | ||
paths, | ||
(_b = options.baseUrl) != null ? _b : (0, import_path2.dirname)(configPath) | ||
(_c = options.baseUrl) != null ? _c : (0, import_path2.dirname)(configPath) | ||
); | ||
@@ -204,0 +206,0 @@ const resolveWithPaths = async (viteResolve, id, importer) => { |
{ | ||
"name": "vite-tsconfig-paths", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Vite resolver for TypeScript compilerOptions.paths", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -159,5 +159,10 @@ import _debug from 'debug' | ||
// Empty `files` array means no files are included. | ||
if (config.files?.length == 0) { | ||
debug(`[!] files array is empty: "${configPath}"`) | ||
// Sometimes a tsconfig is not meant to be used for path resolution, | ||
// but rather for pointing to other tsconfig files and possibly | ||
// being extended by them. This is represented by an explicitly | ||
// empty "files" array and a missing/empty "include" array. | ||
if (config.files?.length == 0 && !config.include?.length) { | ||
debug( | ||
`[!] skipping "${configPath}" as no files can be matched since "files" is empty and "include" is missing or empty` | ||
) | ||
return null | ||
@@ -164,0 +169,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87519
1145