Skip to content

feat: set callerName as rstest#407

Merged
chenjiahan merged 1 commit intomainfrom
callerName
Jul 21, 2025
Merged

feat: set callerName as rstest#407
chenjiahan merged 1 commit intomainfrom
callerName

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Jul 21, 2025

Summary

If you are developing the Rsbuild plugin, you can use api.context.callerName to determine the current plugin is being called.

export const myPlugin = {
  name: 'my-plugin',
  setup(api) {
    const { callerName } = api.context;

    if (callerName === 'rstest') {
      // ...
    } else if (callerName === 'rsbuild') {
      // ...
    }
  },
};

Related Links

https://rsbuild.rs/api/javascript-api/instance#contextcallername

Checklist

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

@netlify
Copy link
Copy Markdown

netlify bot commented Jul 21, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit a776c39
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/687e35f0d2e52400083118d1
😎 Deploy Preview https://deploy-preview-407--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@chenjiahan chenjiahan merged commit 6299ad0 into main Jul 21, 2025
17 checks passed
@chenjiahan chenjiahan deleted the callerName branch July 21, 2025 13:38
@9aoy 9aoy mentioned this pull request Jul 24, 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