From 3dfe885e5328838f14511010634fe6908e452de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Tue, 21 Mar 2023 11:08:23 -0700 Subject: [PATCH 1/2] Fix resolving against the working directory in legacy API --- lib/src/legacy/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/legacy/index.ts b/lib/src/legacy/index.ts index 41fafec4..1631a534 100644 --- a/lib/src/legacy/index.ts +++ b/lib/src/legacy/index.ts @@ -83,6 +83,10 @@ function adjustOptions( throw new Error('Either options.data or options.file must be set.'); } + // In legacy API, the current working directory is always attempted before + // any load path. + options.includePaths = [process.cwd(), ...(options.includePaths ?? [])]; + if ( !isStringOptions(options) && // The `indentedSyntax` option takes precedence over the file extension in the @@ -200,9 +204,7 @@ function pluginThis( context: undefined as unknown as LegacyPluginThis, file: options.file, data: options.data, - includePaths: [process.cwd(), ...(options.includePaths ?? [])].join( - p.delimiter - ), + includePaths: (options.includePaths ?? []).join(p.delimiter), precision: 10, style: 1, indentType: 0, From b8d09ece85cf47641552f5ee1fb34a1e403a8724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 30 Mar 2023 16:54:25 -0700 Subject: [PATCH 2/2] Trigger CI