Skip to content

Commit d87d397

Browse files
author
Angular Builds
committed
3623fe9 fix(@angular-devkit/build-angular): update ESM loader to work with Node.js 18.19.0
1 parent 72c642a commit d87d397

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "17.0.6+sha-ef11781",
3+
"version": "17.0.6+sha-3623fe9",
44
"description": "Angular Webpack Build Facade",
55
"main": "src/index.js",
66
"typings": "src/index.d.ts",
77
"builders": "builders.json",
88
"dependencies": {
99
"@ampproject/remapping": "2.2.1",
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ef11781",
11-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#ef11781",
12-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#ef11781",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3623fe9",
11+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#3623fe9",
12+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#3623fe9",
1313
"@babel/core": "7.23.2",
1414
"@babel/generator": "7.23.0",
1515
"@babel/helper-annotate-as-pure": "7.22.5",
@@ -20,7 +20,7 @@
2020
"@babel/preset-env": "7.23.2",
2121
"@babel/runtime": "7.23.2",
2222
"@discoveryjs/json-ext": "0.5.7",
23-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#ef11781",
23+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#3623fe9",
2424
"@vitejs/plugin-basic-ssl": "1.0.1",
2525
"ansi-colors": "4.1.3",
2626
"autoprefixer": "10.4.16",

src/utils/server-rendering/esm-in-memory-loader/node-18-utils.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ exports.getESMLoaderArgs = exports.callInitializeIfNeeded = void 0;
1111
const node_path_1 = require("node:path");
1212
const node_url_1 = require("node:url");
1313
const node_worker_threads_1 = require("node:worker_threads");
14-
let IS_NODE_18;
15-
function isNode18() {
16-
return (IS_NODE_18 ??= process.versions.node.startsWith('18.'));
14+
const semver_1 = require("semver");
15+
let SUPPORTS_IMPORT_FLAG;
16+
function supportsImportFlag() {
17+
return (SUPPORTS_IMPORT_FLAG ??= (0, semver_1.satisfies)(process.versions.node, '>= 18.19'));
1718
}
1819
/** Call the initialize hook when running on Node.js 18 */
1920
function callInitializeIfNeeded(initialize) {
20-
if (isNode18()) {
21+
if (!supportsImportFlag()) {
2122
initialize(node_worker_threads_1.workerData);
2223
}
2324
}
2425
exports.callInitializeIfNeeded = callInitializeIfNeeded;
2526
function getESMLoaderArgs() {
26-
if (isNode18()) {
27+
if (!supportsImportFlag()) {
2728
return [
2829
'--no-warnings',
2930
'--loader',

uniqueId

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Tue Dec 12 2023 16:48:06 GMT+0000 (Coordinated Universal Time)
1+
Tue Dec 12 2023 17:14:59 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)