Skip to content

feat: add environments to onAfterStartProdServer#3264

Merged
chenjiahan merged 1 commit intoweb-infra-dev:mainfrom
colinaaa:feat/onAfterStartProdServer-environment
Aug 22, 2024
Merged

feat: add environments to onAfterStartProdServer#3264
chenjiahan merged 1 commit intoweb-infra-dev:mainfrom
colinaaa:feat/onAfterStartProdServer-environment

Conversation

@colinaaa
Copy link
Copy Markdown
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).

@netlify
Copy link
Copy Markdown

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

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
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