Skip to content

fix(esm): no need to set library type for web target#6399

Merged
chenjiahan merged 1 commit intomainfrom
web_esm_type_1021
Oct 22, 2025
Merged

fix(esm): no need to set library type for web target#6399
chenjiahan merged 1 commit intomainfrom
web_esm_type_1021

Conversation

@chenjiahan
Copy link
Member

Summary

This change removes the output.library.type: 'module' config when target is web.

The library.type: 'module' option is only needed when building libraries or Node.js applications. For web applications, it has no effect and may even cause unintended behavior.

Checklist

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

Copilot AI review requested due to automatic review settings October 21, 2025 14:09
@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 4184609
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68f79409aba2460008e75b38
😎 Deploy Preview https://deploy-preview-6399--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: 56 (🔴 down 5 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (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 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 the ESM plugin configuration by removing the unnecessary output.library.type: 'module' setting for web targets, as this option is only needed for library or Node.js builds and has no effect (or may cause issues) in web applications.

Key changes:

  • Added conditional logic to only set library.type: 'module' when the target is 'node'
  • Removed the library type configuration from the general output chain that applies to all targets

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

@chenjiahan chenjiahan merged commit 1495a39 into main Oct 22, 2025
15 checks passed
@chenjiahan chenjiahan deleted the web_esm_type_1021 branch October 22, 2025 02:24
@chenjiahan chenjiahan mentioned this pull request Oct 30, 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.

1 participant