Open
Description
Description
Here's a snippet grabbed from /packages/@lwc/rollup-plugin/src/index.ts
:332
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);
As per the comments, specifiers should only contain /
as path delimiters. However, in my case (on Windows), I found them cometimes containing \
as well. Using /[\\/]/
here solves the problem for me.
BTW, extracting namespace
and name
from path.dirname(filename)
also not working for relative filename like ./filename.css
.
Steps to Reproduce
- Set up an LWC Rollup develop env (https://lwc.dev/guide/install#via-rollup)
- Create a custom component
- Run it
Expected Results
No warning messages in the console regarding this reason.
Actual Results
Tons of these messages as each component may prompt one for js, html, and css each.
Version
"@lwc/rollup-plugin": "^8.12.2",
"lwc": "^8.12.2",
"rollup": "^4.29.1"
Possible Solution
Replace .split('/')
with .split(/[\\/]/)
Metadata
Metadata
Assignees
Labels
No labels
Activity