-
Notifications
You must be signed in to change notification settings - Fork 400
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 a component namespace and name parsing issue #5117
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -332,7 +332,7 @@ export default function lwc(pluginOptions: RollupLwcOptions = {}): Plugin { | |||||
const [namespace, name] = | ||||||
// Note we do not need to use path.sep here because this filename contains | ||||||
// a '/' regardless of Windows vs Unix, since it comes from the Rollup `id` | ||||||
specifier?.split('/') ?? path.dirname(filename).split('/').slice(-2); | ||||||
specifier?.split('/') ?? path.dirname(filename).split(/[\\/]/).slice(-2); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Are there any cases where we'd want to split on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that just reverts #5038 🫠 so it would be a regression. path.sep is very unreliable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, path.sep won't work. I'm not sure what the right fix is. I haven't used Windows since XP. |
||||||
|
||||||
/* v8 ignore next */ | ||||||
if (!namespace || !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.
This comment should be updated, because now we do use
path.sep
, but not always.