-
-
Notifications
You must be signed in to change notification settings - Fork 301
fix(cli): improve path normalization of readConfig
#3708
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
Conversation
🦋 Changeset detectedLatest commit: 958e19f The changes in this PR will be included in the next version bump. This PR includes changesets to release 32 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this 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 improves the path normalization in the readConfig function of the @module-federation/cli package by using file URL formatting for dynamic module imports. It also updates the changeset entry to document these improvements.
- Updated readConfig.ts to import the file URL using pathToFileURL for dynamic module imports.
- Added a changeset entry (.changeset/ai-noisy-wolf.md) summarizing the improvements.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/cli/src/utils/readConfig.ts | Uses pathToFileURL to convert file paths to URLs before performing dynamic import. |
.changeset/ai-noisy-wolf.md | Adds documentation regarding the improvements made to readConfig. |
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (1)
packages/cli/src/utils/readConfig.ts:19
- [nitpick] Consider adding an inline comment to clarify why there is a chained '.default' access after the import. This would improve code clarity for other developers reviewing the dynamic import behavior.
const mfConfig = (await import(pathToFileURL(preBundlePath).href)).default
Description
This pull request includes improvements to the
readConfig
function in the@module-federation/cli
package to ensure compatibility with environments requiring file URL formats. Additionally, it updates thechangegen
script in thepackage.json
file to include thecli
package.Improvements to dynamic module import:
.changeset/ai-noisy-wolf.md
: Added a changeset entry describing the improvements to thereadConfig
function.packages/cli/src/utils/readConfig.ts
: ImportedpathToFileURL
from the 'url' module and updated the dynamic import statement formfConfig
to usepathToFileURL(preBundlePath).href
. [1] [2]Updates to
package.json
:package.json
: Updated thechangegen
script to include thecli
package in the list of paths.Related Issue
#3664
Types of changes
Checklist