Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Sep 23, 2024
1 parent 14c70f6 commit cfca535
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/prebundle.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ export default {
postcss: '../postcss',
},
ignoreDts: true,
beforeBundle: skipSemver,
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")', '{}'),
);
skipSemver(task);
},
},
{
name: 'postcss-load-config',
Expand Down

0 comments on commit cfca535

Please sign in to comment.