Skip to content

feat: add environments to onAfterStartProdServer #3264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

colinaaa
Copy link
Contributor

Summary

I have a Rsbuild plugin to print QRCode for all entries. It works well with rsbuild dev:

      api.onAfterStartDevServer(async ({ environments }) => {
        const fooEnvironment = environments['foo']
        const entries = Object.keys(fooEnvironment.entry)
        await printQRCode(entries)
      })

I would also like to print the similar QRCode for rsbuild preview. But I cannot get the entries from onAfterStartProdServer.

This patch simply add environments to onAfterStartProdServer, which will work the same as onAfterStartDevServer.

Related Links

N/A

Checklist

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

Copy link

netlify bot commented Aug 22, 2024

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit d0484d3
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/66c6f521e92f3800083f7c71
😎 Deploy Preview https://deploy-preview-3264--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: 87 (no change from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (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.

Copy link
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.

LGTM 👍

@chenjiahan chenjiahan enabled auto-merge (squash) August 22, 2024 08:23
@chenjiahan chenjiahan merged commit 36aa56f into web-infra-dev:main Aug 22, 2024
10 checks passed
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