Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/shaggy-lamps-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'bob-the-bundler': patch
---

Remove engines.pnpm/yarn/npm in the the output package.json
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,16 @@
| false
| {
/** Files to copy from the package root to dist */
copy?: Array<string>;
};
copy?: Array<string>
}
/** Whether the package should be checked. */
check?:
| false
| {
/** Exports within the package that should not be checked. */
skip?: Array<string>;
};
};
skip?: Array<string>
}
}
```

## 2.0.0
Expand Down
9 changes: 9 additions & 0 deletions src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,15 @@ function rewritePackageJson(pkg: Record<string, any>) {
fields.forEach(field => {
if (pkg[field] !== undefined) {
newPkg[field] = pkg[field];
if (field === 'engines') {
// remove all package managers from engines field
const ignoredPackageManagers = ['npm', 'yarn', 'pnpm'];
for (const packageManager of ignoredPackageManagers) {
if (newPkg[field][packageManager]) {
delete newPkg[field][packageManager];
}
}
}
}
});

Expand Down
3 changes: 2 additions & 1 deletion test/__fixtures__/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "simple",
"type": "module",
"engines": {
"node": ">= 12.0.0"
"node": ">= 12.0.0",
"pnpm": ">= 8.0.0"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down