Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Oct 22, 2025

Summary

should not external static import to dynamic import which will cause mock factory error.

image

62fc8fe3-0846-4ba9-a308-ca66984978fb

Related Links

Checklist

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

@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 11:17
@netlify
Copy link

netlify bot commented Oct 22, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 2ee616a
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68f8bd3344da07000825e395
😎 Deploy Preview https://deploy-preview-638--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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where external static imports were incorrectly converted to dynamic imports, causing mock factory errors. The fix ensures that external modules maintain their import type as commonjs-import instead of being converted to import or module-import.

  • Changed external module handling to use commonjs-import for non-CommonJS dependency types
  • Added test coverage for mocking external node modules with static imports

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/core/src/core/plugins/external.ts Updated external module type resolution to use commonjs-import instead of import or module-import
e2e/externals/mock.test.ts Added test case verifying that external node modules can be properly mocked
e2e/externals/fixtures/getFs.ts Added fixture file with static import of node:fs/promises for testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@9aoy 9aoy requested a review from fi3ework October 22, 2025 11:17
@github-actions
Copy link

github-actions bot commented Oct 22, 2025

📝 Ran ecosystem CI: Open

suite result
rsbuild ✅ success
rslib ✅ success
rsdoctor ❌ failure

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.

1 participant