From 67eea535838e4419cdda1ac4a9c591170d71bf90 Mon Sep 17 00:00:00 2001 From: schelmo Date: Thu, 5 May 2022 15:51:36 +0200 Subject: [PATCH] fix: resolve to package.json only if tsup key exists (#622) Co-authored-by: EGOIST --- .github/workflows/ci.yml | 2 +- src/load.ts | 9 +++++---- test/package.json | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f58caeaa..cc40dd9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - node-version: [14.x, 12.20.0] + node-version: [14.x, 16.x] runs-on: ${{ matrix.os }} diff --git a/src/load.ts b/src/load.ts index 0daa70c9..14cf013c 100644 --- a/src/load.ts +++ b/src/load.ts @@ -36,8 +36,8 @@ export async function loadTsupConfig( cwd: string ): Promise<{ path?: string; data?: ReturnType }> { const configJoycon = new JoyCon() - const configPath = await configJoycon.resolve( - [ + const configPath = await configJoycon.resolve({ + files: [ 'tsup.config.ts', 'tsup.config.js', 'tsup.config.cjs', @@ -46,8 +46,9 @@ export async function loadTsupConfig( 'package.json', ], cwd, - path.parse(cwd).root - ) + stopDir: path.parse(cwd).root, + packageKey: 'tsup', + }) if (configPath) { if (configPath.endsWith('.json')) { diff --git a/test/package.json b/test/package.json index c2dd6fcc..506d7531 100644 --- a/test/package.json +++ b/test/package.json @@ -5,5 +5,6 @@ "graphql": "^15.3.0", "graphql-tools": "^5.0.0", "vue": "3.0.5" - } + }, + "tsup": {} }