Skip to content

feat: support add plugins for specified environment#2986

Merged
chenjiahan merged 10 commits intoweb-infra-dev:mainfrom
9aoy:feat/environment-plugins
Jul 23, 2024
Merged

feat: support add plugins for specified environment#2986
chenjiahan merged 10 commits intoweb-infra-dev:mainfrom
9aoy:feat/environment-plugins

Conversation

@9aoy
Copy link
Copy Markdown
Contributor

@9aoy 9aoy commented Jul 22, 2024

Summary

Support add plugins for specified environment.

For example, enable the react plugin only in the web environment:

import { pluginReact } from '@rsbuild/plugin-react';

export default {
  environments: {
    web: {
      output: {
        target: 'web',
      },
      plugins: [pluginReact()],
    },
    node: {
      output: {
        target: 'node',
      },
    },
  },
};

TODO: Some plugins do not yet support single-environment registration because they use api.modifyRsbuildConfig hook to modify the global configuration.

Related Links

#2620

Checklist

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

@netlify
Copy link
Copy Markdown

netlify bot commented Jul 22, 2024

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit e8418ba
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/669f50ca7b73110008d3dcde
😎 Deploy Preview https://deploy-preview-2986--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: 75 (🔴 down 12 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
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 July 22, 2024 08:50
9aoy and others added 6 commits July 22, 2024 18:45
Co-authored-by: neverland <jait.chen@foxmail.com>
Co-authored-by: neverland <jait.chen@foxmail.com>
Co-authored-by: neverland <jait.chen@foxmail.com>
Co-authored-by: neverland <jait.chen@foxmail.com>
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

Awesome 🎉

@chenjiahan chenjiahan enabled auto-merge (squash) July 23, 2024 06:45
@chenjiahan chenjiahan merged commit 2b249da into web-infra-dev:main Jul 23, 2024
yifancong added a commit that referenced this pull request Jul 23, 2024
fix: rsdoctor plugin

fix: rsdoctor plugin

feat: support add plugins for specified environment (#2986)

Co-authored-by: neverland <jait.chen@foxmail.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

fix: modify the criteria for verifying the Rsdoctor plugin.
yifancong added a commit that referenced this pull request Jul 23, 2024
fix: rsdoctor plugin

fix: rsdoctor plugin

feat: support add plugins for specified environment (#2986)

Co-authored-by: neverland <jait.chen@foxmail.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

fix: modify the criteria for verifying the Rsdoctor plugin.
yifancong added a commit that referenced this pull request Jul 23, 2024
fix: rsdoctor plugin

fix: rsdoctor plugin

feat: support add plugins for specified environment (#2986)

Co-authored-by: neverland <jait.chen@foxmail.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

Update packages/core/src/plugins/rsdoctor.ts

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

fix: modify the criteria for verifying the Rsdoctor plugin.

fix: modify the criteria for verifying the Rsdoctor plugin.
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