-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(angular): add missing forceEsbuild option to dev-server executor (#…
- Loading branch information
1 parent
d7f5cb0
commit 1c161c6
Showing
6 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './normalize-options'; | ||
export * from './validate-options'; |
19 changes: 19 additions & 0 deletions
19
packages/angular/src/builders/dev-server/lib/validate-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { stripIndents } from '@nx/devkit'; | ||
import { lt } from 'semver'; | ||
import { getInstalledAngularVersionInfo } from '../../../executors/utilities/angular-version-utils'; | ||
import type { Schema } from '../schema'; | ||
|
||
export function validateOptions(options: Schema): void { | ||
const { major: angularMajorVersion, version: angularVersion } = | ||
getInstalledAngularVersionInfo(); | ||
|
||
if (lt(angularVersion, '16.1.0') && options.forceEsbuild !== undefined) { | ||
throw new Error(stripIndents`The "forceEsbuild" option is only supported in Angular >= 16.1.0. You are currently using "${angularVersion}". | ||
You can resolve this error by removing the "forceEsbuild" option or by migrating to Angular 16.1.0.`); | ||
} | ||
|
||
if (angularMajorVersion < 17 && options.esbuildMiddleware?.length > 0) { | ||
throw new Error(stripIndents`The "esbuildMiddleware" option is only supported in Angular >= 17.0.0. You are currently using "${angularVersion}". | ||
You can resolve this error by removing the "esbuildMiddleware" option or by migrating to Angular 17.0.0.`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters