Skip to content

Commit

Permalink
perf: remove cosmiconfig from postcss-loader (#3063)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Jul 29, 2024
1 parent 24272a3 commit a0b0476
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/prebundle.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ export default {
semver: './semver',
},
ignoreDts: true,
beforeBundle(task) {
replaceFileContent(join(task.depPath, 'dist/utils.js'), (content) =>
// Rsbuild uses `postcss-load-config` and no need to use `cosmiconfig`.
// the ralevent code will never be executed, so we can replace it with an empty object.
content.replaceAll('require("cosmiconfig")', '{}'),
);
},
afterBundle: writeEmptySemver,
},
{
Expand Down

0 comments on commit a0b0476

Please sign in to comment.