Skip to content

Commit a747f5c

Browse files
committed
refactor: update application builder entry points to treat bare strings as module specifiers
Previously `foo` would be treated as a relative path, which meant it was not possible to use an NPM package as an entry point. This now requires `./foo` for relative paths while `foo` is treated as a module specifier referring to an NPM package called `foo`. TODO: Fix Jest.
1 parent 0bf6242 commit a747f5c

File tree

1 file changed

+3
-4
lines changed
  • packages/angular_devkit/build_angular/src/builders/application

1 file changed

+3
-4
lines changed

packages/angular_devkit/build_angular/src/builders/application/options.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,9 @@ function normalizeEntryPoints(
415415
? parsedEntryPoint.name
416416
: path.join(parsedEntryPoint.dir, parsedEntryPoint.name);
417417

418-
// Get the full file path to the entry point input.
419-
const entryPointPath = path.isAbsolute(entryPoint)
420-
? entryPoint
421-
: path.join(workspaceRoot, entryPoint);
418+
// Get the full file path to a relative entry point input. Leave bare specifiers alone so they are resolved as modules.
419+
const isRelativePath = entryPoint.startsWith('.');
420+
const entryPointPath = isRelativePath ? path.join(workspaceRoot, entryPoint) : entryPoint;
422421

423422
// Check for conflicts with previous entry points.
424423
const existingEntryPointPath = entryPointPaths[entryPointName];

0 commit comments

Comments
 (0)