Skip to content

Commit

Permalink
Simplified the fix
Browse files Browse the repository at this point in the history
Simplified the fix as only having replaced the path delimiter for parsing `namespace` and `name` from filenames.
  • Loading branch information
Mr-VincentW authored Jan 9, 2025
1 parent ba87df0 commit d62ce4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@lwc/rollup-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('/') ?? /(?:([^\\/]+?)[\\/])?([^\\/]+?)(?:[\\/]\2)?(?:\.scoped)?\.[^.]+$/.exec(filename)?.slice(1);
specifier?.split('/') ?? path.dirname(filename).split(/[\\/]/).slice(-2);

/* v8 ignore next */
if (!namespace || !name) {
Expand Down

0 comments on commit d62ce4c

Please sign in to comment.