Skip to content

Commit

Permalink
chore: reduce multiple esbuild versions (#4624)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Sep 12, 2023
1 parent f509548 commit b165f17
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 461 deletions.
19 changes: 17 additions & 2 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,27 @@ function readPackage(pkg, _context) {
};
}

// Some packages still depend on esbuild < 0.17, so we upgrade it manually.
// ref: https://github.com/lukeed/tsm/issues/48
if (
pkg.name === 'tsm' ||
pkg.name === 'vite' ||
pkg.name === 'esbuild-loader'
) {
pkg.dependencies.esbuild = '0.17.19';
}

const outsideModernPkgList = ['@modern-js/mdx-rs-binding'];

if ((pkg.name.startsWith('@rspress/') || pkg.name.startsWith('rspress')) && pkg.dependencies) {
if (
(pkg.name.startsWith('@rspress/') || pkg.name.startsWith('rspress')) &&
pkg.dependencies
) {
pkg.dependencies = Object.fromEntries(
Object.entries(pkg.dependencies).map(([key, value]) =>
key.startsWith('@modern-js/') && !outsideModernPkgList.includes(key) ? [key, 'workspace:*'] : [key, value],
key.startsWith('@modern-js/') && !outsideModernPkgList.includes(key)
? [key, 'workspace:*']
: [key, value],
),
);
}
Expand Down
Loading

0 comments on commit b165f17

Please sign in to comment.