Skip to content

Commit 60c218f

Browse files
author
Angular Builds
committed
9494b1f test(@angular/build): use correct builder names in integration tests
1 parent c897756 commit 60c218f

File tree

8 files changed

+39
-13
lines changed

8 files changed

+39
-13
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/build",
3-
"version": "20.0.0-next.3+sha-8a89438",
3+
"version": "20.0.0-next.3+sha-9494b1f",
44
"description": "Official build system for Angular",
55
"keywords": [
66
"Angular CLI",
@@ -23,7 +23,7 @@
2323
"builders": "builders.json",
2424
"dependencies": {
2525
"@ampproject/remapping": "2.3.0",
26-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8a89438",
26+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#9494b1f",
2727
"@babel/core": "7.26.10",
2828
"@babel/helper-annotate-as-pure": "7.25.9",
2929
"@babel/helper-split-export-declaration": "7.24.7",
@@ -60,7 +60,7 @@
6060
"@angular/platform-browser": "^20.0.0 || ^20.0.0-next.0",
6161
"@angular/platform-server": "^20.0.0 || ^20.0.0-next.0",
6262
"@angular/service-worker": "^20.0.0 || ^20.0.0-next.0",
63-
"@angular/ssr": "github:angular/angular-ssr-builds#8a89438",
63+
"@angular/ssr": "github:angular/angular-ssr-builds#9494b1f",
6464
"karma": "^6.4.0",
6565
"less": "^4.2.0",
6666
"ng-packagr": "^20.0.0 || ^20.0.0-next.0",
@@ -81,7 +81,7 @@
8181
"@angular/service-worker": {
8282
"optional": true
8383
},
84-
"@angular/ssr": "github:angular/angular-ssr-builds#8a89438",
84+
"@angular/ssr": "github:angular/angular-ssr-builds#9494b1f",
8585
"karma": {
8686
"optional": true
8787
},

src/builders/application/options.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s
203203
};
204204
templateUpdates: boolean;
205205
incrementalResults: boolean;
206+
customConditions: string[] | undefined;
206207
}>;
207208
export declare function getLocaleBaseHref(baseHref: string | undefined, i18n: NormalizedApplicationBuildOptions['i18nOptions'], locale: string): string | undefined;
208209
export {};

src/builders/application/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ async function normalizeOptions(context, projectName, options, extensions) {
312312
security,
313313
templateUpdates: !!options.templateUpdates,
314314
incrementalResults: !!options.incrementalResults,
315+
customConditions: options.conditions,
315316
};
316317
}
317318
async function getTailwindConfig(searchDirectories, workspaceRoot, context) {

src/builders/application/schema.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ export type Schema = {
3737
* Automatically clear the terminal screen during rebuilds.
3838
*/
3939
clearScreen?: boolean;
40+
/**
41+
* Custom package resolution conditions used to resolve conditional exports/imports.
42+
* Defaults to ['module', 'development'/'production']. The following special conditions are
43+
* always present if the requirements are satisfied: 'default', 'import', 'require',
44+
* 'browser', 'node'.
45+
*/
46+
conditions?: string[];
4047
/**
4148
* Define the crossorigin attribute setting of elements that provide CORS support.
4249
*/

src/builders/application/schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@
292292
"type": "string"
293293
}
294294
},
295+
"conditions": {
296+
"description": "Custom package resolution conditions used to resolve conditional exports/imports. Defaults to ['module', 'development'/'production']. The following special conditions are always present if the requirements are satisfied: 'default', 'import', 'require', 'browser', 'node'.",
297+
"type": "array",
298+
"items": {
299+
"type": "string"
300+
}
301+
},
295302
"fileReplacements": {
296303
"description": "Replace compilation source files with other compilation source files in the build.",
297304
"type": "array",

src/tools/esbuild/application-code-bundle.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ function getEsBuildServerCommonOptions(options) {
382382
};
383383
}
384384
function getEsBuildCommonOptions(options) {
385-
const { workspaceRoot, outExtension, optimizationOptions, sourcemapOptions, tsconfig, externalDependencies, outputNames, preserveSymlinks, jit, loaderExtensions, jsonLogs, i18nOptions, } = options;
385+
const { workspaceRoot, outExtension, optimizationOptions, sourcemapOptions, tsconfig, externalDependencies, outputNames, preserveSymlinks, jit, loaderExtensions, jsonLogs, i18nOptions, customConditions, } = options;
386386
// Ensure unique hashes for i18n translation changes when using post-process inlining.
387387
// This hash value is added as a footer to each file and ensures that the output file names (with hashes)
388388
// change when translation files have changed. If this is not done the post processed files may have
@@ -393,18 +393,28 @@ function getEsBuildCommonOptions(options) {
393393
const i18nHash = Object.values(i18nOptions.locales).reduce((data, locale) => data + locale.files.map((file) => file.integrity || '').join('|'), '');
394394
footer = { js: `/**i18n:${(0, node_crypto_1.createHash)('sha256').update(i18nHash).digest('hex')}*/` };
395395
}
396+
// Core conditions that are always included
397+
const conditions = [
398+
// Required to support rxjs 7.x which will use es5 code if this condition is not present
399+
'es2015',
400+
'es2020',
401+
];
402+
// Append custom conditions if present
403+
if (customConditions) {
404+
conditions.push(...customConditions);
405+
}
406+
else {
407+
// Include default conditions
408+
conditions.push('module');
409+
conditions.push(optimizationOptions.scripts ? 'production' : 'development');
410+
}
396411
return {
397412
absWorkingDir: workspaceRoot,
398413
format: 'esm',
399414
bundle: true,
400415
packages: 'bundle',
401416
assetNames: outputNames.media,
402-
conditions: [
403-
'es2020',
404-
'es2015',
405-
'module',
406-
optimizationOptions.scripts ? 'production' : 'development',
407-
],
417+
conditions,
408418
resolveExtensions: ['.ts', '.tsx', '.mjs', '.js', '.cjs'],
409419
metafile: true,
410420
legalComments: options.extractLicenses ? 'none' : 'eof',

src/utils/normalize-cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
1010
exports.normalizeCacheOptions = normalizeCacheOptions;
1111
const node_path_1 = require("node:path");
1212
/** Version placeholder is replaced during the build process with actual package version */
13-
const VERSION = '20.0.0-next.3+sha-8a89438';
13+
const VERSION = '20.0.0-next.3+sha-9494b1f';
1414
function hasCacheMetadata(value) {
1515
return (!!value &&
1616
typeof value === 'object' &&

uniqueId

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Mon Mar 31 2025 10:58:01 GMT+0000 (Coordinated Universal Time)
1+
Mon Mar 31 2025 18:39:55 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)