-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(plugin): support for esm loader which its ext is .js in rspack #393
Conversation
✅ Deploy Preview for rsdoctor ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
packages/utils/src/build/json.ts
Outdated
if (dirname(current) === current) { | ||
break; | ||
} | ||
current = dirname(current); |
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.
dirname(current)
is called twice, which can be stored in a variable
return; | ||
} | ||
|
||
// Some packages will put an empty package.json in the source folder. |
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.
I thought Node.js will also consider empty package.json as a valid package.json file, should we skip it?
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.
这里不可以视为 valid,否则会导致重复包计算准确,很多 ui 库会在组件文件夹下留个 package.json 设置 sideEffect 属性且没有 name。这种情况就要继续递归向上查找。
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.
For Node.js type="module"
, the empty package.json should not be skipped.
If we want to skip package.json for component libraries, maybe we can add a param to control it?
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.
create a new issue to fix this case:#394
feat(plugin): support for esm loader which its ext is .js
1757369
to
7af081f
Compare
Summary
feat(plugin): support for esm loader which its ext is .js
Related Links
closes: #330