Skip to content

feat: support use rspack in tools.bundlerChain#5002

Merged
chenjiahan merged 2 commits intomainfrom
rspack-util
Apr 11, 2025
Merged

feat: support use rspack in tools.bundlerChain#5002
chenjiahan merged 2 commits intomainfrom
rspack-util

Conversation

@9aoy
Copy link
Copy Markdown
Contributor

@9aoy 9aoy commented Apr 11, 2025

Summary

Support use rspack in tools.bundlerChain.

export default {
  tools: {
    bundlerChain: (chain, { rspack }) => {
      chain.plugin('define').use(rspack.DefinePlugin, [
        {
          'process.env': {
            NODE_ENV: JSON.stringify(process.env.NODE_ENV),
          },
        },
      ]);
    },
  },
};

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 11, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit ed25907
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/67f8b632e7ed790008edf812
😎 Deploy Preview https://deploy-preview-5002--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 74 (🔴 down 8 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@9aoy 9aoy requested a review from chenjiahan April 11, 2025 06:09
export default {
tools: {
bundlerChain: (chain, { rspack }) => {
chain.plugin('define').use(rspack.DefinePlugin, [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'define' id is the same as the Rsbuild builtin CHAIN_ID.PLUGIN.DEFINE, can we use extra-define in this example to avoid conflict.

@chenjiahan chenjiahan merged commit 5322462 into main Apr 11, 2025
10 checks passed
@chenjiahan chenjiahan deleted the rspack-util branch April 11, 2025 06:32
@chenjiahan chenjiahan mentioned this pull request Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants