这是indexloc提供的服务,不要输入任何密码
Skip to content

fix: resolve to package.json only if tsup key exists #622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
9 changes: 5 additions & 4 deletions src/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export async function loadTsupConfig(
cwd: string
): Promise<{ path?: string; data?: ReturnType<typeof defineConfig> }> {
const configJoycon = new JoyCon()
const configPath = await configJoycon.resolve(
[
const configPath = await configJoycon.resolve({
files: [
'tsup.config.ts',
'tsup.config.js',
'tsup.config.cjs',
Expand All @@ -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')) {
Expand Down
3 changes: 2 additions & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"graphql": "^15.3.0",
"graphql-tools": "^5.0.0",
"vue": "3.0.5"
}
},
"tsup": {}
}