Skip to content
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

fix: commonjs static library mode #9390

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hai-x
Copy link
Contributor

@hai-x hai-x commented Feb 19, 2025

Summary

Fixes web-infra-dev/rslib#714 (comment)

Checklist

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

Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for rspack ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a52bc66
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67bc66c8a636460008c1e339
😎 Deploy Preview https://deploy-preview-9390--rspack.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 site configuration.

Copy link

codspeed-hq bot commented Feb 19, 2025

CodSpeed Performance Report

Merging #9390 will not alter performance

Comparing hai-x:fix-cjs-statis (a52bc66) with main (cf4d882)

Summary

✅ 7 untouched benchmarks

@hai-x hai-x changed the title [WIP] fix: commonjs static library mode fix: commonjs static library mode Feb 19, 2025
@hai-x hai-x marked this pull request as ready for review February 19, 2025 14:56
@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Feb 19, 2025
@hai-x
Copy link
Contributor Author

hai-x commented Feb 24, 2025

@ahabhgk Could you help review it? Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this test to packages/rspack-test-tools/tests/configCases

Copy link
Member

Choose a reason for hiding this comment

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

FWIW, webpack/webpack#19242 is trying to add some test into webpack. We could wait for a while to let it merged into webpack first. Or we could move it to rspack test if there's no response for a while.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think both are fine, what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Let's see if it's merged tomorrow.

Copy link
Member

@fi3ework fi3ework left a comment

Choose a reason for hiding this comment

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

This test case for commonjs-static is supposed to be uncommented here.

// TODO: amd esm import exports presence check
// {
// resolve: {
// alias: {
// library: path.resolve(
// testPath,
// "../0-create-library/commonjs-static-external.js"
// ),
// external: path.resolve(__dirname, "node_modules/external.js")
// }
// },
// plugins: [
// new webpack.DefinePlugin({
// NAME: JSON.stringify("commonjs-static with external"),
// TEST_EXTERNAL: true
// })
// ]
// },

@hai-x
Copy link
Contributor Author

hai-x commented Feb 24, 2025

This test case for commonjs-static is supposed to be uncommented here.

// TODO: amd esm import exports presence check
// {
// resolve: {
// alias: {
// library: path.resolve(
// testPath,
// "../0-create-library/commonjs-static-external.js"
// ),
// external: path.resolve(__dirname, "node_modules/external.js")
// }
// },
// plugins: [
// new webpack.DefinePlugin({
// NAME: JSON.stringify("commonjs-static with external"),
// TEST_EXTERNAL: true
// })
// ]
// },

Ok. I will uncomment it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: No commonjs export names annotations generated
3 participants