Skip to content

Commit

Permalink
Merge pull request #1379 from embroider-build/package-name-bug
Browse files Browse the repository at this point in the history
don't confuse webpack requests with packageNames
  • Loading branch information
ef4 authored Mar 24, 2023
2 parents 00ec2e7 + ba4c1cb commit e7c1789
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/shared-internals/src/package-name.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { isAbsolute } from 'path';

export default function absolutePackageName(specifier: string): string | undefined {
if (specifier[0] === '.' || isAbsolute(specifier)) {
// Not an absolute specifier
if (
// relative paths:
specifier[0] === '.' ||
// webpack-specific microsyntax for internal requests:
specifier[0] === '!' ||
specifier[0] === '-' ||
// absolute paths:
isAbsolute(specifier)
) {
// Does not refer to a package
return;
}
let parts = specifier.split('/');
Expand Down

0 comments on commit e7c1789

Please sign in to comment.