diff --git a/package.json b/package.json index 4d6f4a54..e2642b61 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "17.0.0-next.5+sha-11449b1", + "version": "17.0.0-next.5+sha-c5f3ec7", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.2.1", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#11449b1b8", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#11449b1b8", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#11449b1b8", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c5f3ec71f", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#c5f3ec71f", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c5f3ec71f", "@babel/core": "7.22.17", "@babel/generator": "7.22.15", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.22.15", "@babel/runtime": "7.22.15", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#11449b1b8", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#c5f3ec71f", "@vitejs/plugin-basic-ssl": "1.0.1", "ansi-colors": "4.1.3", "autoprefixer": "10.4.15", diff --git a/src/builders/application/execute-build.js b/src/builders/application/execute-build.js index 9aa5bd75..eb499dbc 100644 --- a/src/builders/application/execute-build.js +++ b/src/builders/application/execute-build.js @@ -27,12 +27,18 @@ const environment_options_1 = require("../../utils/environment-options"); const prerender_1 = require("../../utils/server-rendering/prerender"); const service_worker_1 = require("../../utils/service-worker"); const supported_browsers_1 = require("../../utils/supported-browsers"); +const i18n_1 = require("./i18n"); // eslint-disable-next-line max-lines-per-function async function executeBuild(options, context, rebuildState) { const startTime = process.hrtime.bigint(); const { projectRoot, workspaceRoot, serviceWorker, optimizationOptions, serverEntryPoint, assets, indexHtmlOptions, cacheOptions, prerenderOptions, appShellOptions, ssrOptions, verbose, } = options; const browsers = (0, supported_browsers_1.getSupportedBrowsers)(projectRoot, context.logger); const target = (0, utils_1.transformSupportedBrowsersToTargets)(browsers); + // Load active translations if inlining + // TODO: Integrate into watch mode and only load changed translations + if (options.i18nOptions.shouldInline) { + await (0, i18n_1.loadActiveTranslations)(context, options.i18nOptions); + } // Reuse rebuild state or create new bundle contexts for code and global stylesheets let bundlerContexts = rebuildState?.rebuildContexts; const codeBundleCache = rebuildState?.codeBundleCache ?? @@ -89,11 +95,15 @@ async function executeBuild(options, context, rebuildState) { */ let indexContentOutputNoCssInlining; // Generate index HTML file - if (indexHtmlOptions) { - const { content, contentWithoutCriticalCssInlined, errors, warnings } = await (0, index_html_generator_1.generateIndexHtml)(initialFiles, executionResult, { + // If localization is enabled, index generation is handled in the inlining process. + // NOTE: Localization with SSR is not currently supported. + if (indexHtmlOptions && !options.i18nOptions.shouldInline) { + const { content, contentWithoutCriticalCssInlined, errors, warnings } = await (0, index_html_generator_1.generateIndexHtml)(initialFiles, executionResult.outputFiles, { ...options, optimizationOptions, - }); + }, + // Set lang attribute to the defined source locale if present + options.i18nOptions.hasDefinedSourceLocale ? options.i18nOptions.sourceLocale : undefined); indexContentOutputNoCssInlining = contentWithoutCriticalCssInlined; printWarningsAndErrorsToConsole(context, warnings, errors); executionResult.addOutputFile(indexHtmlOptions.output, content); @@ -144,6 +154,10 @@ async function executeBuild(options, context, rebuildState) { (0, utils_1.logBuildStats)(context, metafile, initialFiles, estimatedTransferSizes); const buildTime = Number(process.hrtime.bigint() - startTime) / 10 ** 9; context.logger.info(`Application bundle generation complete. [${buildTime.toFixed(3)} seconds]`); + // Perform i18n translation inlining if enabled + if (options.i18nOptions.shouldInline) { + await (0, i18n_1.inlineI18n)(options, executionResult, initialFiles); + } return executionResult; } exports.executeBuild = executeBuild; @@ -155,4 +169,4 @@ function printWarningsAndErrorsToConsole(context, warnings, errors) { context.logger.warn(warning);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pO1xuICB9XG5cbiAgbG9nQnVpbGRTdGF0cyhjb250ZXh0LCBtZXRhZmlsZSwgaW5pdGlhbEZpbGVzLCBlc3RpbWF0ZWRUcmFuc2ZlclNpemVzKTtcblxuICBjb25zdCBidWlsZFRpbWUgPSBOdW1iZXIocHJvY2Vzcy5ocnRpbWUuYmlnaW50KCkgLSBzdGFydFRpbWUpIC8gMTAgKiogOTtcbiAgY29udGV4dC5sb2dnZXIuaW5mbyhgQXBwbGljYXRpb24gYnVuZGxlIGdlbmVyYXRpb24gY29tcGxldGUuIFske2J1aWxkVGltZS50b0ZpeGVkKDMpfSBzZWNvbmRzXWApO1xuXG4gIC8vIFBlcmZvcm0gaTE4biB0cmFuc2xhdGlvbiBpbmxpbmluZyBpZiBlbmFibGVkXG4gIGlmIChvcHRpb25zLmkxOG5PcHRpb25zLnNob3VsZElubGluZSkge1xuICAgIGF3YWl0IGlubGluZUkxOG4ob3B0aW9ucywgZXhlY3V0aW9uUmVzdWx0LCBpbml0aWFsRmlsZXMpO1xuICB9XG5cbiAgcmV0dXJuIGV4ZWN1dGlvblJlc3VsdDtcbn1cblxuZnVuY3Rpb24gcHJpbnRXYXJuaW5nc0FuZEVycm9yc1RvQ29uc29sZShcbiAgY29udGV4dDogQnVpbGRlckNvbnRleHQsXG4gIHdhcm5pbmdzOiBzdHJpbmdbXSxcbiAgZXJyb3JzOiBzdHJpbmdbXSxcbik6IHZvaWQge1xuICBmb3IgKGNvbnN0IGVycm9yIG9mIGVycm9ycykge1xuICAgIGNvbnRleHQubG9nZ2VyLmVycm9yKGVycm9yKTtcbiAgfVxuICBmb3IgKGNvbnN0IHdhcm5pbmcgb2Ygd2FybmluZ3MpIHtcbiAgICBjb250ZXh0LmxvZ2dlci53YXJuKHdhcm5pbmcpO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/src/builders/application/i18n.d.ts b/src/builders/application/i18n.d.ts new file mode 100644 index 00000000..842298b1 --- /dev/null +++ b/src/builders/application/i18n.d.ts @@ -0,0 +1,25 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { BuilderContext } from '@angular-devkit/architect'; +import { InitialFileRecord } from '../../tools/esbuild/bundler-context'; +import { ExecutionResult } from '../../tools/esbuild/bundler-execution-result'; +import { NormalizedApplicationBuildOptions } from './options'; +/** + * Inlines all active locales as specified by the application build options into all + * application JavaScript files created during the build. + * @param options The normalized application builder options used to create the build. + * @param executionResult The result of an executed build. + * @param initialFiles A map containing initial file information for the executed build. + */ +export declare function inlineI18n(options: NormalizedApplicationBuildOptions, executionResult: ExecutionResult, initialFiles: Map): Promise; +/** + * Loads all active translations using the translation loaders from the `@angular/localize` package. + * @param context The architect builder context for the current build. + * @param i18n The normalized i18n options to use. + */ +export declare function loadActiveTranslations(context: BuilderContext, i18n: NormalizedApplicationBuildOptions['i18nOptions']): Promise; diff --git a/src/builders/application/i18n.js b/src/builders/application/i18n.js new file mode 100644 index 00000000..97b49571 --- /dev/null +++ b/src/builders/application/i18n.js @@ -0,0 +1,110 @@ +"use strict"; +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadActiveTranslations = exports.inlineI18n = void 0; +const node_path_1 = require("node:path"); +const i18n_inliner_1 = require("../../tools/esbuild/i18n-inliner"); +const index_html_generator_1 = require("../../tools/esbuild/index-html-generator"); +const utils_1 = require("../../tools/esbuild/utils"); +const environment_options_1 = require("../../utils/environment-options"); +const i18n_options_1 = require("../../utils/i18n-options"); +const load_translations_1 = require("../../utils/load-translations"); +const url_1 = require("../../utils/url"); +/** + * Inlines all active locales as specified by the application build options into all + * application JavaScript files created during the build. + * @param options The normalized application builder options used to create the build. + * @param executionResult The result of an executed build. + * @param initialFiles A map containing initial file information for the executed build. + */ +async function inlineI18n(options, executionResult, initialFiles) { + // Create the multi-threaded inliner with common options and the files generated from the build. + const inliner = new i18n_inliner_1.I18nInliner({ + missingTranslation: options.i18nOptions.missingTranslationBehavior ?? 'warning', + outputFiles: executionResult.outputFiles, + shouldOptimize: options.optimizationOptions.scripts, + }, environment_options_1.maxWorkers); + // For each active locale, use the inliner to process the output files of the build. + const updatedOutputFiles = []; + const updatedAssetFiles = []; + try { + for (const locale of options.i18nOptions.inlineLocales) { + // A locale specific set of files is returned from the inliner. + const localeOutputFiles = await inliner.inlineForLocale(locale, options.i18nOptions.locales[locale].translation); + // Generate locale specific index HTML files + if (options.indexHtmlOptions) { + const { content, errors, warnings } = await (0, index_html_generator_1.generateIndexHtml)(initialFiles, localeOutputFiles, { + ...options, + baseHref: getLocaleBaseHref(options.baseHref, options.i18nOptions, locale) ?? options.baseHref, + }, locale); + localeOutputFiles.push((0, utils_1.createOutputFileFromText)(options.indexHtmlOptions.output, content)); + } + // Update directory with locale base + if (options.i18nOptions.flatOutput !== true) { + localeOutputFiles.forEach((file) => { + file.path = (0, node_path_1.join)(locale, file.path); + }); + for (const assetFile of executionResult.assetFiles) { + updatedAssetFiles.push({ + source: assetFile.source, + destination: (0, node_path_1.join)(locale, assetFile.destination), + }); + } + } + updatedOutputFiles.push(...localeOutputFiles); + } + } + finally { + await inliner.close(); + } + // Update the result with all localized files + executionResult.outputFiles = updatedOutputFiles; + // Assets are only changed if not using the flat output option + if (options.i18nOptions.flatOutput !== true) { + executionResult.assetFiles = updatedAssetFiles; + } +} +exports.inlineI18n = inlineI18n; +function getLocaleBaseHref(baseHref, i18n, locale) { + if (i18n.flatOutput) { + return undefined; + } + if (i18n.locales[locale] && i18n.locales[locale].baseHref !== '') { + return (0, url_1.urlJoin)(baseHref || '', i18n.locales[locale].baseHref ?? `/${locale}/`); + } + return undefined; +} +/** + * Loads all active translations using the translation loaders from the `@angular/localize` package. + * @param context The architect builder context for the current build. + * @param i18n The normalized i18n options to use. + */ +async function loadActiveTranslations(context, i18n) { + // Load locale data and translations (if present) + let loader; + for (const [locale, desc] of Object.entries(i18n.locales)) { + if (!i18n.inlineLocales.has(locale) && locale !== i18n.sourceLocale) { + continue; + } + if (!desc.files.length) { + continue; + } + loader ??= await (0, load_translations_1.createTranslationLoader)(); + (0, i18n_options_1.loadTranslations)(locale, desc, context.workspaceRoot, loader, { + warn(message) { + context.logger.warn(message); + }, + error(message) { + throw new Error(message); + }, + }, undefined, i18n.duplicateTranslationBehavior); + } +} +exports.loadActiveTranslations = loadActiveTranslations; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaTE4bi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXJfZGV2a2l0L2J1aWxkX2FuZ3VsYXIvc3JjL2J1aWxkZXJzL2FwcGxpY2F0aW9uL2kxOG4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBR0gseUNBQWlDO0FBR2pDLG1FQUErRDtBQUMvRCxtRkFBNkU7QUFDN0UscURBQXFFO0FBQ3JFLHlFQUE2RDtBQUM3RCwyREFBNEQ7QUFDNUQscUVBQXdFO0FBQ3hFLHlDQUEwQztBQUcxQzs7Ozs7O0dBTUc7QUFDSSxLQUFLLFVBQVUsVUFBVSxDQUM5QixPQUEwQyxFQUMxQyxlQUFnQyxFQUNoQyxZQUE0QztJQUU1QyxnR0FBZ0c7SUFDaEcsTUFBTSxPQUFPLEdBQUcsSUFBSSwwQkFBVyxDQUM3QjtRQUNFLGtCQUFrQixFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUMsMEJBQTBCLElBQUksU0FBUztRQUMvRSxXQUFXLEVBQUUsZUFBZSxDQUFDLFdBQVc7UUFDeEMsY0FBYyxFQUFFLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxPQUFPO0tBQ3BELEVBQ0QsZ0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AgICBjb250aW51ZTtcbiAgICB9XG5cbiAgICBpZiAoIWRlc2MuZmlsZXMubGVuZ3RoKSB7XG4gICAgICBjb250aW51ZTtcbiAgICB9XG5cbiAgICBsb2FkZXIgPz89IGF3YWl0IGNyZWF0ZVRyYW5zbGF0aW9uTG9hZGVyKCk7XG5cbiAgICBsb2FkVHJhbnNsYXRpb25zKFxuICAgICAgbG9jYWxlLFxuICAgICAgZGVzYyxcbiAgICAgIGNvbnRleHQud29ya3NwYWNlUm9vdCxcbiAgICAgIGxvYWRlcixcbiAgICAgIHtcbiAgICAgICAgd2FybihtZXNzYWdlKSB7XG4gICAgICAgICAgY29udGV4dC5sb2dnZXIud2FybihtZXNzYWdlKTtcbiAgICAgICAgfSxcbiAgICAgICAgZXJyb3IobWVzc2FnZSkge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgfSxcbiAgICAgIH0sXG4gICAgICB1bmRlZmluZWQsXG4gICAgICBpMThuLmR1cGxpY2F0ZVRyYW5zbGF0aW9uQmVoYXZpb3IsXG4gICAgKTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/src/builders/application/index.js b/src/builders/application/index.js index a5afec75..2d8b1b21 100644 --- a/src/builders/application/index.js +++ b/src/builders/application/index.js @@ -26,6 +26,17 @@ async function* buildApplicationInternal(options, context, infrastructureSetting return; } const normalizedOptions = await (0, options_1.normalizeOptions)(context, projectName, options); + // Warn about prerender/ssr not yet supporting localize + if (normalizedOptions.i18nOptions.shouldInline && + (normalizedOptions.prerenderOptions || + normalizedOptions.ssrOptions || + normalizedOptions.appShellOptions)) { + context.logger.warn(`Prerendering, App Shell, and SSR are not yet supported with the 'localize' option and will be disabled for this build.`); + normalizedOptions.prerenderOptions = + normalizedOptions.ssrOptions = + normalizedOptions.appShellOptions = + undefined; + } yield* (0, build_action_1.runEsBuildBuildAction)((rebuildState) => (0, execute_build_1.executeBuild)(normalizedOptions, context, rebuildState), { watch: normalizedOptions.watch, poll: normalizedOptions.poll, @@ -46,4 +57,4 @@ function buildApplication(options, context) { } exports.buildApplication = buildApplication; exports.default = (0, architect_1.createBuilder)(buildApplication); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyX2RldmtpdC9idWlsZF9hbmd1bGFyL3NyYy9idWlsZGVycy9hcHBsaWNhdGlvbi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7OztHQU1HOzs7QUFFSCx5REFBeUY7QUFFekYseURBQStEO0FBQy9ELGlEQUFxRTtBQUNyRSxpREFBdUQ7QUFDdkQsbURBQStDO0FBQy9DLHVDQUFnRjtBQUd6RSxLQUFLLFNBQVMsQ0FBQyxDQUFDLHdCQUF3QixDQUM3QyxPQUEwQyxFQUMxQyxPQUF1QixFQUN2QixzQkFFQztJQU9ELHlCQUF5QjtJQUN6QixJQUFBLHdDQUE4QixFQUFDLE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FBQztJQUV0RCw4QkFBOEI7SUFDOUIsTUFBTSxJQUFBLGtDQUFvQixFQUFDLE9BQU8sQ0FBQyxDQUFDO0lBRXBDLHFEQUFxRDtJQUNyRCxNQUFNLFdBQVcsR0FBRyxPQUFPLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQztJQUM1QyxJQUFJLENBQUMsV0FBVyxFQUFFO1FBQ2hCLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLDhEQUE4RCxDQUFDLENBQUM7UUFFckYsT0FBTztLQUNSO0lBRUQsTUFBTSxpQkFBaUIsR0FBRyxNQUFNLElBQUEsMEJBQWdCLEVBQUMsT0FBTyxFQUFFLFdBQVcsRUFBRSxPQUFPLENBQUMsQ0FBQztJQUNoRixLQUFLL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YXRpb25JbnRlcm5hbChvcHRpb25zLCBjb250ZXh0KTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgY3JlYXRlQnVpbGRlcihidWlsZEFwcGxpY2F0aW9uKTtcbiJdfQ== \ No newline at end of file diff --git a/src/builders/application/options.d.ts b/src/builders/application/options.d.ts index ec19884f..f2631ed1 100644 --- a/src/builders/application/options.d.ts +++ b/src/builders/application/options.d.ts @@ -25,6 +25,11 @@ interface InternalOptions { * Currently used by the dev-server to support prebundling. */ externalPackages?: boolean; + /** + * Forces the output from the localize post-processing to not create nested directories per locale output. + * This is only used by the development server which currently only supports a single locale per build. + */ + forceI18nFlatOutput?: boolean; } /** Full set of options for `application` builder. */ export type ApplicationBuilderInternalOptions = Omit & { diff --git a/src/builders/application/options.js b/src/builders/application/options.js index 60b12a5e..cda3278f 100644 --- a/src/builders/application/options.js +++ b/src/builders/application/options.js @@ -43,6 +43,9 @@ async function normalizeOptions(context, projectName, options) { const i18nOptions = (0, i18n_options_1.createI18nOptions)(projectMetadata, options.localize); i18nOptions.duplicateTranslationBehavior = options.i18nDuplicateTranslation; i18nOptions.missingTranslationBehavior = options.i18nMissingTranslation; + if (options.forceI18nFlatOutput) { + i18nOptions.flatOutput = true; + } const entryPoints = normalizeEntryPoints(workspaceRoot, options.browser, options.entryPoints); const tsconfig = node_path_1.default.join(workspaceRoot, options.tsConfig); const outputPath = normalizeDirectoryPath(node_path_1.default.join(workspaceRoot, options.outputPath)); @@ -260,4 +263,4 @@ function normalizeDirectoryPath(path) { } return path; } -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXJfZGV2a2l0L2J1aWxkX2FuZ3VsYXIvc3JjL2J1aWxkZXJzL2FwcGxpY2F0aW9uL29wdGlvbnMudHMiX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ldHVybiBwYXRoLnNsaWNlKDAsIC0xKTtcbiAgfVxuXG4gIHJldHVybiBwYXRoO1xufVxuIl19 \ No newline at end of file diff --git a/src/builders/browser-esbuild/builder-status-warnings.js b/src/builders/browser-esbuild/builder-status-warnings.js index de61d091..535471ae 100644 --- a/src/builders/browser-esbuild/builder-status-warnings.js +++ b/src/builders/browser-esbuild/builder-status-warnings.js @@ -10,11 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.logBuilderStatusWarnings = void 0; const UNSUPPORTED_OPTIONS = [ 'budgets', - // * i18n support - 'localize', - // The following two have no effect when localize is not enabled - // 'i18nDuplicateTranslation', - // 'i18nMissingTranslation', // * Deprecated 'deployUrl', // * Always enabled with esbuild @@ -50,4 +45,4 @@ function logBuilderStatusWarnings(options, context) { } } exports.logBuilderStatusWarnings = logBuilderStatusWarnings; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGRlci1zdGF0dXMtd2FybmluZ3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyX2RldmtpdC9idWlsZF9hbmd1bGFyL3NyYy9idWlsZGVycy9icm93c2VyLWVzYnVpbGQvYnVpbGRlci1zdGF0dXMtd2FybmluZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBS0gsTUFBTSxtQkFBbUIsR0FBdUM7SUFDOUQsU0FBUztJQUVULGlCQUFpQjtJQUNqQixVQUFVO0lBQ1YsZ0VBQWdFO0lBQ2hFLDhCQUE4QjtJQUM5Qiw0QkFBNEI7SUFFNUIsZUFBZTtJQUNmLFdBQVc7SUFFWCxnQ0FBZ0M7SUFDaEMsaUJBQWlCO0lBRWpCLDhEQUE4RDtJQUM5RCxhQUFhO0lBQ2IsYUFBYTtJQUNiLHFCQUFxQjtJQUV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IHtcbiAgICAgIGNvbnRpbnVlO1xuICAgIH1cbiAgICBpZiAoQXJyYXkuaXNBcnJheSh2YWx1ZSkgJiYgdmFsdWUubGVuZ3RoID09PSAwKSB7XG4gICAgICBjb250aW51ZTtcbiAgICB9XG4gICAgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcgJiYgT2JqZWN0LmtleXModmFsdWUpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgY29udGludWU7XG4gICAgfVxuXG4gICAgaWYgKFxuICAgICAgdW5zdXBwb3J0ZWRPcHRpb24gPT09ICduYW1lZENodW5rcycgfHxcbiAgICAgIHVuc3VwcG9ydGVkT3B0aW9uID09PSAndmVuZG9yQ2h1bmsnIHx8XG4gICAgICB1bnN1cHBvcnRlZE9wdGlvbiA9PT0gJ3Jlc291cmNlc091dHB1dFBhdGgnIHx8XG4gICAgICB1bnN1cHBvcnRlZE9wdGlvbiA9PT0gJ2RlcGxveVVybCdcbiAgICApIHtcbiAgICAgIGNvbnRleHQubG9nZ2VyLndhcm4oXG4gICAgICAgIGBUaGUgJyR7dW5zdXBwb3J0ZWRPcHRpb259JyBvcHRpb24gaXMgbm90IHVzZWQgYnkgdGhpcyBidWlsZGVyIGFuZCB3aWxsIGJlIGlnbm9yZWQuYCxcbiAgICAgICk7XG4gICAgICBjb250aW51ZTtcbiAgICB9XG5cbiAgICBjb250ZXh0LmxvZ2dlci53YXJuKGBUaGUgJyR7dW5zdXBwb3J0ZWRPcHRpb259JyBvcHRpb24gaXMgbm90IHlldCBzdXBwb3J0ZWQgYnkgdGhpcyBidWlsZGVyLmApO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 8e06700d..b5317ce3 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -40,6 +40,7 @@ const node_crypto_1 = require("node:crypto"); const promises_1 = require("node:fs/promises"); const node_path_1 = __importStar(require("node:path")); const javascript_transformer_1 = require("../../tools/esbuild/javascript-transformer"); +const i18n_locale_plugin_1 = require("../../tools/vite/i18n-locale-plugin"); const render_page_1 = require("../../utils/server-rendering/render-page"); const webpack_browser_config_1 = require("../../utils/webpack-browser-config"); const browser_esbuild_1 = require("../browser-esbuild"); @@ -63,6 +64,17 @@ async function* serveWithVite(serverOptions, builderName, context) { if (serverOptions.servePath === undefined && browserOptions.baseHref !== undefined) { serverOptions.servePath = browserOptions.baseHref; } + // The development server currently only supports a single locale when localizing. + // This matches the behavior of the Webpack-based development server but could be expanded in the future. + if (browserOptions.localize === true || + (Array.isArray(browserOptions.localize) && browserOptions.localize.length > 1)) { + context.logger.warn('Localization (`localize` option) has been disabled. The development server only supports localizing a single locale per build.'); + browserOptions.localize = false; + } + else if (browserOptions.localize) { + // When localization is enabled with a single locale, force a flat path to maintain behavior with the existing Webpack-based dev server. + browserOptions.forceI18nFlatOutput = true; + } // Setup the prebundling transformer that will be shared across Vite prebundling requests const prebundleTransformer = new javascript_transformer_1.JavaScriptTransformer( // Always enable JIT linking to support applications built with and without AOT. @@ -248,6 +260,7 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, external: prebundleExclude, }, plugins: [ + (0, i18n_locale_plugin_1.createAngularLocaleDataPlugin)(), { name: 'vite:angular-memory', // Ensures plugin hooks run before built-in Vite hooks @@ -452,4 +465,4 @@ function pathnameWithoutServePath(url, serverOptions) { } return pathname; } -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidml0ZS1zZXJ2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyX2RldmtpdC9idWlsZF9hbmd1bGFyL3NyYy9idWlsZGVycy9kZXYtc2VydmVyL3ZpdGUtc2VydmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7O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ICAgbmV4dCgpO1xuXG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gUmVzb3VyY2UgZmlsZXMgYXJlIGhhbmRsZWQgZGlyZWN0bHkuXG4gICAgICAgICAgICAvLyBHbG9iYWwgc3R5bGVzaGVldHMgKENTUyBmaWxlcykgYXJlIGN1cnJlbnRseSBjb25zaWRlcmVkIHJlc291cmNlcyB0byB3b3JrYXJvdW5kXG4gICAgICAgICAgICAvLyBkZXYgc2VydmVyIHNvdXJjZW1hcCBpc3N1ZXMgd2l0aCBzdHlsZXNoZWV0cy5cbiAgICAgICAgICAgIGlmIChleHRlbnNpb24gIT09ICcuanMnICYmIGV4dGVuc2lvbiAhPT0gJy5odG1sJykge1xuICAgICAgICAgICAgICBjb25zdCBvdXRwdXRGaWxlID0gb3V0cHV0RmlsZXMuZ2V0KHBhdGhuYW1lKTtcbiAgICAgICAgICAgICAgaWYgKG91dHB1dEZpbGUpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtaW1lVHlwZSA9IGxvb2t1cE1pbWVUeXBlKGV4dGVuc2lvbik7XG4gICAgICAgICAgICAgICAgaWYgKG1pbWVUeXBlKSB7XG4gICAgICAgICAgICAgICAgICByZXMuc2V0SGVhZGVyKCdDb250ZW50LVR5cGUnLCBtaW1lVHlwZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlcy5zZXRIZWFkZXIoJ0NhY2hlLUNvbnRyb2wnLCAnbm8tY2FjaGUnKTtcbiAgICAgICAgICAgICAgICBpZiAoc2VydmVyT3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhzZXJ2ZXJPcHRpb25zLmhlYWRlcnMpLmZvckVhY2goKFtuYW1lLCB2YWx1ZV0pID0+XG4gICAgICAgICAgICAgICAgICAgIHJlcy5zZXRIZWFkZXIobmFtZSwgdmFsdWUpLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzLmVuZChvdXRwdXRGaWxlLmNvbnRlbnRzKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBuZXh0KCk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAvLyBSZXR1cm5pbmcgYSBmdW5jdGlvbiwgaW5zdGFsbHMgbWlkZGxld2FyZSBhZnRlciB0aGUgbWFpbiB0cmFuc2Zvcm0gbWlkZGxld2FyZSBidXRcbiAgICAgICAgICAvLyBiZWZvcmUgdGhlIGJ1aWx0LWluIEhUTUwgbWlkZGxld2FyZVxuICAgICAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgICAgICBmdW5jdGlvbiBhbmd1bGFyU1NSTWlkZGxld2FyZShcbiAgICAgICAgICAgICAgcmVxOiBDb25uZWN0LkluY29taW5nTWVzc2FnZSxcbiAgICAgICAgICAgICAgcmVzOiBTZXJ2ZXJSZXNwb25zZSxcbiAgICAgICAgICAgICAgbmV4dDogQ29ubmVjdC5OZXh0RnVuY3Rpb24sXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgY29uc3QgdXJsID0gcmVxLm9yaWdpbmFsVXJsO1xuICAgICAgICAgICAgICBpZiAoIXVybCB8fCB1cmwuZW5kc1dpdGgoJy5odG1sJykpIHtcbiAgICAgICAgICAgICAgICBuZXh0KCk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zdCBwb3RlbnRpYWxQcmVyZW5kZXJlZCA9IG91dHB1dEZpbGVzLmdldChwb3NpeC5qb2luKHVybCwgJ2luZGV4Lmh0bWwnKSk/LmNvbnRlbnRzO1xuICAgICAgICAgICAgICBpZiAocG90ZW50aWFsUHJlcmVuZGVyZWQpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBjb250ZW50ID0gQnVmZmVyLmZyb20ocG90ZW50aWFsUHJlcmVuZGVyZWQpLnRvU3RyaW5nKCd1dGYtOCcpO1xuICAgICAgICAgICAgICAgIGlmIChTU0dfTUFSS0VSX1JFR0VYUC50ZXN0KGNvbnRlbnQpKSB7XG4gICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1JbmRleEh0bWxBbmRBZGRIZWFkZXJzKHVybCwgcG90ZW50aWFsUHJlcmVuZGVyZWQsIHJlcywgbmV4dCk7XG5cbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zdCByYXdIdG1sID0gb3V0cHV0RmlsZXMuZ2V0KCcvaW5kZXguc2VydmVyLmh0bWwnKT8uY29udGVudHM7XG4gICAgICAgICAgICAgIGlmICghcmF3SHRtbCkge1xuICAgICAgICAgICAgICAgIG5leHQoKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHRyYW5zZm9ybUluZGV4SHRtbEFuZEFkZEhlYWRlcnModXJsLCByYXdIdG1sLCByZXMsIG5leHQsIGFzeW5jIChodG1sKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgeyBjb250ZW50IH0gPSBhd2FpdCByZW5kZXJQYWdlKHtcbiAgICAgICAgICAgICAgICAgIGRvY3VtZW50OiBodG1sLFxuICAgICAgICAgICAgICAgICAgcm91dGU6IHBhdGhuYW1lV2l0aG91dFNlcnZlUGF0aCh1cmwsIHNlcnZlck9wdGlvbnMpLFxuICAgICAgICAgICAgICAgICAgc2VydmVyQ29udGV4dDogJ3NzcicsXG4gICAgICAgICAgICAgICAgICBsb2FkQnVuZGxlOiAocGF0aDogc3RyaW5nKSA9PlxuICAgICAgICAgICAgICAgICAgICBzZXJ2ZXIuc3NyTG9hZE1vZHVsZShwYXRoLnNsaWNlKDEpKSBhcyBSZXR1cm5UeXBlPFxuICAgICAgICAgICAgICAgICAgICAgIE5vbk51bGxhYmxlPFJlbmRlck9wdGlvbnNbJ2xvYWRCdW5kbGUnXT5cbiAgICAgICAgICAgICAgICAgICAgPixcbiAgICAgICAgICAgICAgICAgIC8vIEZpbGVzIGhlcmUgYXJlIG9ubHkgbmVlZGVkIGZvciBjcml0aWNhbCBDU1MgaW5saW5pbmcuXG4gICAgICAgICAgICAgICAgICBvdXRwdXRGaWxlczoge30sXG4gICAgICAgICAgICAgICAgICAvLyBUT0RPOiBhZGQgc3VwcG9ydCBmb3IgY3JpdGljYWwgY3NzIGlubGluaW5nLlxuICAgICAgICAgICAgICAgICAgaW5saW5lQ3JpdGljYWxDc3M6IGZhbHNlLFxuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRlbnQ7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc3NyKSB7XG4gICAgICAgICAgICAgIHNlcnZlci5taWRkbGV3YXJlcy51c2UoYW5ndWxhclNTUk1pZGRsZXdhcmUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzZXJ2ZXIubWlkZGxld2FyZXMudXNlKGZ1bmN0aW9uIGFuZ3VsYXJJbmRleE1pZGRsZXdhcmUocmVxLCByZXMsIG5leHQpIHtcbiAgICAgICAgICAgICAgaWYgKCFyZXEudXJsKSB7XG4gICAgICAgICAgICAgICAgbmV4dCgpO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gUGFyc2UgdGhlIGluY29taW5nIHJlcXVlc3QuXG4gICAgICAgICAgICAgIC8vIFRoZSBiYXNlIG9mIHRoZSBVUkwgaXMgdW51c2VkIGJ1dCByZXF1aXJlZCB0byBwYXJzZSB0aGUgVVJMLlxuICAgICAgICAgICAgICBjb25zdCBwYXRobmFtZSA9IHBhdGhuYW1lV2l0aG91dFNlcnZlUGF0aChyZXEudXJsLCBzZXJ2ZXJPcHRpb25zKTtcblxuICAgICAgICAgICAgICBpZiAocGF0aG5hbWUgPT09ICcvJyB8fCBwYXRobmFtZSA9PT0gYC9pbmRleC5odG1sYCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJhd0h0bWwgPSBvdXRwdXRGaWxlcy5nZXQoJy9pbmRleC5odG1sJyk/LmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgIGlmIChyYXdIdG1sKSB7XG4gICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1JbmRleEh0bWxBbmRBZGRIZWFkZXJzKHJlcS51cmwsIHJhd0h0bWwsIHJlcywgbmV4dCk7XG5cbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBuZXh0KCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgZnVuY3Rpb24gdHJhbnNmb3JtSW5kZXhIdG1sQW5kQWRkSGVhZGVycyhcbiAgICAgICAgICAgIHVybDogc3RyaW5nLFxuICAgICAgICAgICAgcmF3SHRtbDogVWludDhBcnJheSxcbiAgICAgICAgICAgIHJlczogU2VydmVyUmVzcG9uc2U8aW1wb3J0KCdodHRwJykuSW5jb21pbmdNZXNzYWdlPixcbiAgICAgICAgICAgIG5leHQ6IENvbm5lY3QuTmV4dEZ1bmN0aW9uLFxuICAgICAgICAgICAgYWRkaXRpb25hbFRyYW5zZm9ybWVyPzogKGh0bWw6IHN0cmluZykgPT4gUHJvbWlzZTxzdHJpbmcgfCB1bmRlZmluZWQ+LFxuICAgICAgICAgICkge1xuICAgICAgICAgICAgc2VydmVyXG4gICAgICAgICAgICAgIC50cmFuc2Zvcm1JbmRleEh0bWwodXJsLCBCdWZmZXIuZnJvbShyYXdIdG1sKS50b1N0cmluZygndXRmLTgnKSlcbiAgICAgICAgICAgICAgLnRoZW4oYXN5bmMgKHByb2Nlc3NlZEh0bWwpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoYWRkaXRpb25hbFRyYW5zZm9ybWVyKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdCBjb250ZW50ID0gYXdhaXQgYWRkaXRpb25hbFRyYW5zZm9ybWVyKHByb2Nlc3NlZEh0bWwpO1xuICAgICAgICAgICAgICAgICAgaWYgKCFjb250ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQoKTtcblxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIHByb2Nlc3NlZEh0bWwgPSBjb250ZW50O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJlcy5zZXRIZWFkZXIoJ0NvbnRlbnQtVHlwZScsICd0ZXh0L2h0bWwnKTtcbiAgICAgICAgICAgICAgICByZXMuc2V0SGVhZGVyKCdDYWNoZS1Db250cm9sJywgJ25vLWNhY2hlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHNlcnZlck9wdGlvbnMuaGVhZGVycykge1xuICAgICAgICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMoc2VydmVyT3B0aW9ucy5oZWFkZXJzKS5mb3JFYWNoKChbbmFtZSwgdmFsdWVdKSA9PlxuICAgICAgICAgICAgICAgICAgICByZXMuc2V0SGVhZGVyKG5hbWUsIHZhbHVlKSxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlcy5lbmQocHJvY2Vzc2VkSHRtbCk7XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIC5jYXRjaCgoZXJyb3IpID0+IG5leHQoZXJyb3IpKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICB9LFxuICAgIF0sXG4gICAgb3B0aW1pemVEZXBzOiB7XG4gICAgICAvLyBPbmx5IGVuYWJsZSB3aXRoIG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pbGVzLmhhcyhmaWxlKSkge1xuICAgICAgICAgICAgcmV0dXJuIHNvdXJjZTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGxvYWQoaWQpIHtcbiAgICAgICAgICBjb25zdCBbZmlsZV0gPSBpZC5zcGxpdCgnPycsIDEpO1xuICAgICAgICAgIGNvbnN0IGNvZGVDb250ZW50cyA9IG91dHB1dEZpbGVzLmdldChmaWxlKT8uY29udGVudHM7XG4gICAgICAgICAgaWYgKGNvZGVDb250ZW50cyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3QgY29kZSA9IEJ1ZmZlci5mcm9tKGNvZGVDb250ZW50cykudG9TdHJpbmcoJ3V0Zi04Jyk7XG4gICAgICAgICAgY29uc3QgbWFwQ29udGVudHMgPSBvdXRwdXRGaWxlcy5nZXQoZmlsZSArICcubWFwJyk/LmNvbnRlbnRzO1xuXG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIC8vIFJlbW92ZSBzb3VyY2UgbWFwIFVSTCBjb21tZW50cyBmcm9tIHRoZSBjb2RlIGlmIGEgc291cmNlbWFwIGlzIHByZXNlbnQuXG4gICAgICAgICAgICAvLyBWaXRlIHdpbGwgaW5saW5lIGFuZCBhZGQgYW4gYWRkaXRpb25hbCBzb3VyY2VtYXAgVVJMIGZvciB0aGUgc291cmNlbWFwLlxuICAgICAgICAgICAgY29kZTogbWFwQ29udGVudHMgPyBjb2RlLnJlcGxhY2UoL15cXC9cXC8jIHNvdXJjZU1hcHBpbmdVUkw9W15cXHJcXG5dKi9nbSwgJycpIDogY29kZSxcbiAgICAgICAgICAgIG1hcDogbWFwQ29udGVudHMgJiYgQnVmZmVyLmZyb20obWFwQ29udGVudHMpLnRvU3RyaW5nKCd1dGYtOCcpLFxuICAgICAgICAgIH07XG4gICAgICAgIH0sXG4gICAgICAgIGNvbmZpZ3VyZVNlcnZlcih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IGlmIChzZXJ2ZXJPcHRpb25zLmhlYWRlcnMpIHtcbiAgICAgICAgICAgICAgICAgIE9iamVjdC5lbnRyaWVzKHNlcnZlck9wdGlvbnMuaGVhZGVycykuZm9yRWFjaCgoW25hbWUsIHZhbHVlXSkgPT5cbiAgICAgICAgICAgICAgICAgICAgcmVzLnNldEhlYWRlcihuYW1lLCB2YWx1ZSksXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXMuZW5kKG91dHB1dEZpbGUuY29udGVudHMpO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG5leHQoKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIC8vIFJldHVybmluZyBhIGZ1bmN0aW9uLCBpbnN0YWxscyBtaWRkbGV3YXJlIGFmdGVyIHRoZSBtYWluIHRyYW5zZm9ybSBtaWRkbGV3YXJlIGJ1dFxuICAgICAgICAgIC8vIGJlZm9yZSB0aGUgYnVpbHQtaW4gSFRNTCBtaWRkbGV3YXJlXG4gICAgICAgICAgcmV0dXJuICgpID0+IHtcbiAgICAgICAgICAgIGZ1bmN0aW9uIGFuZ3VsYXJTU1JNaWRkbGV3YXJlKFxuICAgICAgICAgICAgICByZXE6IENvbm5lY3QuSW5jb21pbmdNZXNzYWdlLFxuICAgICAgICAgICAgICByZXM6IFNlcnZlclJlc3BvbnNlLFxuICAgICAgICAgICAgICBuZXh0OiBDb25uZWN0Lk5leHRGdW5jdGlvbixcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICBjb25zdCB1cmwgPSByZXEub3JpZ2luYWxVcmw7XG4gICAgICAgICAgICAgIGlmICghdXJsIHx8IHVybC5lbmRzV2l0aCgnLmh0bWwnKSkge1xuICAgICAgICAgICAgICAgIG5leHQoKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGNvbnN0IHBvdGVudGlhbFByZXJlbmRlcmVkID0gb3V0cHV0RmlsZXMuZ2V0KHBvc2l4LmpvaW4odXJsLCAnaW5kZXguaHRtbCcpKT8uY29udGVudHM7XG4gICAgICAgICAgICAgIGlmIChwb3RlbnRpYWxQcmVyZW5kZXJlZCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGNvbnRlbnQgPSBCdWZmZXIuZnJvbShwb3RlbnRpYWxQcmVyZW5kZXJlZCkudG9TdHJpbmcoJ3V0Zi04Jyk7XG4gICAgICAgICAgICAgICAgaWYgKFNTR19NQVJLRVJfUkVHRVhQLnRlc3QoY29udGVudCkpIHtcbiAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybUluZGV4SHRtbEFuZEFkZEhlYWRlcnModXJsLCBwb3RlbnRpYWxQcmVyZW5kZXJlZCwgcmVzLCBuZXh0KTtcblxuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGNvbnN0IHJhd0h0bWwgPSBvdXRwdXRGaWxlcy5nZXQoJy9pbmRleC5zZXJ2ZXIuaHRtbCcpPy5jb250ZW50cztcbiAgICAgICAgICAgICAgaWYgKCFyYXdIdG1sKSB7XG4gICAgICAgICAgICAgICAgbmV4dCgpO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdHJhbnNmb3JtSW5kZXhIdG1sQW5kQWRkSGVhZGVycyh1cmwsIHJhd0h0bWwsIHJlcywgbmV4dCwgYXN5bmMgKGh0bWwpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCB7IGNvbnRlbnQgfSA9IGF3YWl0IHJlbmRlclBhZ2Uoe1xuICAgICAgICAgICAgICAgICAgZG9jdW1lbnQ6IGh0bWwsXG4gICAgICAgICAgICAgICAgICByb3V0ZTogcGF0aG5hbWVXaXRob3V0U2VydmVQYXRoKHVybCwgc2VydmVyT3B0aW9ucyksXG4gICAgICAgICAgICAgICAgICBzZXJ2ZXJDb250ZXh0OiAnc3NyJyxcbiAgICAgICAgICAgICAgICAgIGxvYWRCdW5kbGU6IChwYXRoOiBzdHJpbmcpID0+XG4gICAgICAgICAgICAgICAgICAgIHNlcnZlci5zc3JMb2FkTW9kdWxlKHBhdGguc2xpY2UoMSkpIGFzIFJldHVyblR5cGU8XG4gICAgICAgICAgICAgICAgICAgICAgTm9uTnVsbGFibGU8UmVuZGVyT3B0aW9uc1snbG9hZEJ1bmRsZSddPlxuICAgICAgICAgICAgICAgICAgICA+LFxuICAgICAgICAgICAgICAgICAgLy8gRmlsZXMgaGVyZSBhcmUgb25seSBuZWVkZWQgZm9yIGNyaXRpY2FsIENTUyBpbmxpbmluZy5cbiAgICAgICAgICAgICAgICAgIG91dHB1dEZpbGVzOiB7fSxcbiAgICAgICAgICAgICAgICAgIC8vIFRPRE86IGFkZCBzdXBwb3J0IGZvciBjcml0aWNhbCBjc3MgaW5saW5pbmcuXG4gICAgICAgICAgICAgICAgICBpbmxpbmVDcml0aWNhbENzczogZmFsc2UsXG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gY29udGVudDtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzc3IpIHtcbiAgICAgICAgICAgICAgc2VydmVyLm1pZGRsZXdhcmVzLnVzZShhbmd1bGFyU1NSTWlkZGxld2FyZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHNlcnZlci5taWRkbGV3YXJlcy51c2UoZnVuY3Rpb24gYW5ndWxhckluZGV4TWlkZGxld2FyZShyZXEsIHJlcywgbmV4dCkge1xuICAgICAgICAgICAgICBpZiAoIXJlcS51cmwpIHtcbiAgICAgICAgICAgICAgICBuZXh0KCk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBQYXJzZSB0aGUgaW5jb21pbmcgcmVxdWVzdC5cbiAgICAgICAgICAgICAgLy8gVGhlIGJhc2Ugb2YgdGhlIFVSTCBpcyB1bnVzZWQgYnV0IHJlcXVpcmVkIHRvIHBhcnNlIHRoZSBVUkwuXG4gICAgICAgICAgICAgIGNvbnN0IHBhdGhuYW1lID0gcGF0aG5hbWVXaXRob3V0U2VydmVQYXRoKHJlcS51cmwsIHNlcnZlck9wdGlvbnMpO1xuXG4gICAgICAgICAgICAgIGlmIChwYXRobmFtZSA9PT0gJy8nIHx8IHBhdGhuYW1lID09PSBgL2luZGV4Lmh0bWxgKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgcmF3SHRtbCA9IG91dHB1dEZpbGVzLmdldCgnL2luZGV4Lmh0bWwnKT8uY29udGVudHM7XG4gICAgICAgICAgICAgICAgaWYgKHJhd0h0bWwpIHtcbiAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybUluZGV4SHRtbEFuZEFkZEhlYWRlcnMocmVxLnVybCwgcmF3SHRtbCwgcmVzLCBuZXh0KTtcblxuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIG5leHQoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICBmdW5jdGlvbiB0cmFuc2Zvcm1JbmRleEh0bWxBbmRBZGRIZWFkZXJzKFxuICAgICAgICAgICAgdXJsOiBzdHJpbmcsXG4gICAgICAgICAgICByYXdIdG1sOiBVaW50OEFycmF5LFxuICAgICAgICAgICAgcmVzOiBTZXJ2ZXJSZXNwb25zZTxpbXBvcnQoJ2h0dHAnKS5JbmNvbWluZ01lc3NhZ2U+LFxuICAgICAgICAgICAgbmV4dDogQ29ubmVjdC5OZXh0RnVuY3Rpb24sXG4gICAgICAgICAgICBhZGRpdGlvbmFsVHJhbnNmb3JtZXI/OiAoaHRtbDogc3RyaW5nKSA9PiBQcm9taXNlPHN0cmluZyB8IHVuZGVmaW5lZD4sXG4gICAgICAgICAgKSB7XG4gICAgICAgICAgICBzZXJ2ZXJcbiAgICAgICAgICAgICAgLnRyYW5zZm9ybUluZGV4SHRtbCh1cmwsIEJ1ZmZlci5mcm9tKHJhd0h0bWwpLnRvU3RyaW5nKCd1dGYtOCcpKVxuICAgICAgICAgICAgICAudGhlbihhc3luYyAocHJvY2Vzc2VkSHRtbCkgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChhZGRpdGlvbmFsVHJhbnNmb3JtZXIpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGNvbnRlbnQgPSBhd2FpdCBhZGRpdGlvbmFsVHJhbnNmb3JtZXIocHJvY2Vzc2VkSHRtbCk7XG4gICAgICAgICAgICAgICAgICBpZiAoIWNvbnRlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dCgpO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgcHJvY2Vzc2VkSHRtbCA9IGNvbnRlbnQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmVzLnNldEhlYWRlcignQ29udGVudC1UeXBlJywgJ3RleHQvaHRtbCcpO1xuICAgICAgICAgICAgICAgIHJlcy5zZXRIZWFkZXIoJ0NhY2hlLUNvbnRyb2wnLCAnbm8tY2FjaGUnKTtcbiAgICAgICAgICAgICAgICBpZiAoc2VydmVyT3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhzZXJ2ZXJPcHRpb25zLmhlYWRlcnMpLmZvckVhY2goKFtuYW1lLCB2YWx1ZV0pID0+XG4gICAgICAgICAgICAgICAgICAgIHJlcy5zZXRIZWFkZXIobmFtZSwgdmFsdWUpLFxuICAgICAgICAgICAgICAgICAgK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HBhdGhuYW1lV2l0aG91dFNlcnZlUGF0aCh1cmw6IHN0cmluZywgc2VydmVyT3B0aW9uczogTm9ybWFsaXplZERldlNlcnZlck9wdGlvbnMpOiBzdHJpbmcge1xuICBjb25zdCBwYXJzZWRVcmwgPSBuZXcgVVJMKHVybCwgJ2h0dHA6Ly9sb2NhbGhvc3QnKTtcbiAgbGV0IHBhdGhuYW1lID0gZGVjb2RlVVJJQ29tcG9uZW50KHBhcnNlZFVybC5wYXRobmFtZSk7XG4gIGlmIChzZXJ2ZXJPcHRpb25zLnNlcnZlUGF0aCAmJiBwYXRobmFtZS5zdGFydHNXaXRoKHNlcnZlck9wdGlvbnMuc2VydmVQYXRoKSkge1xuICAgIHBhdGhuYW1lID0gcGF0aG5hbWUuc2xpY2Uoc2VydmVyT3B0aW9ucy5zZXJ2ZVBhdGgubGVuZ3RoKTtcbiAgICBpZiAocGF0aG5hbWVbMF0gIT09ICcvJykge1xuICAgICAgcGF0aG5hbWUgPSAnLycgKyBwYXRobmFtZTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcGF0aG5hbWU7XG59XG4iXX0= \ No newline at end of file diff --git a/src/builders/extract-i18n/application-extraction.js b/src/builders/extract-i18n/application-extraction.js index 2d396585..8d95cfa2 100644 --- a/src/builders/extract-i18n/application-extraction.js +++ b/src/builders/extract-i18n/application-extraction.js @@ -21,6 +21,7 @@ async function extractMessages(options, builderName, context, extractorConstruct const buildOptions = (await context.validateOptions(await context.getTargetOptions(options.browserTarget), builderName)); buildOptions.optimization = false; buildOptions.sourceMap = { scripts: true, vendor: true }; + buildOptions.localize = false; let build; if (builderName === '@angular-devkit/build-angular:application') { build = application_1.buildApplicationInternal; @@ -134,4 +135,4 @@ function setupLocalizeExtractor(extractorConstructor, files, context) { }); return extractor; } -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbGljYXRpb24tZXh0cmFjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJ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ciwge1xuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgYmFzZVBhdGg6IGNvbnRleHQud29ya3NwYWNlUm9vdCBhcyBhbnksXG4gICAgdXNlU291cmNlTWFwczogdHJ1ZSxcbiAgfSk7XG5cbiAgcmV0dXJuIGV4dHJhY3Rvcjtcbn1cbiJdfQ== \ No newline at end of file diff --git a/src/tools/esbuild/application-code-bundle.js b/src/tools/esbuild/application-code-bundle.js index 7eb15a5e..f797dfbb 100644 --- a/src/tools/esbuild/application-code-bundle.js +++ b/src/tools/esbuild/application-code-bundle.js @@ -12,11 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createServerCodeBundleOptions = exports.createBrowserCodeBundleOptions = void 0; const node_assert_1 = __importDefault(require("node:assert")); +const node_crypto_1 = require("node:crypto"); const promises_1 = require("node:fs/promises"); const node_path_1 = require("node:path"); const environment_options_1 = require("../../utils/environment-options"); const compiler_plugin_1 = require("./angular/compiler-plugin"); const compiler_plugin_options_1 = require("./compiler-plugin-options"); +const i18n_locale_plugin_1 = require("./i18n-locale-plugin"); const rxjs_esm_resolution_plugin_1 = require("./rxjs-esm-resolution-plugin"); const sourcemap_ignorelist_plugin_1 = require("./sourcemap-ignorelist-plugin"); const utils_1 = require("./utils"); @@ -49,10 +51,42 @@ function createBrowserCodeBundleOptions(options, target, sourceFileCache) { buildOptions.packages = 'external'; } const polyfills = options.polyfills ? [...options.polyfills] : []; + // Angular JIT mode requires the runtime compiler if (jit) { polyfills.push('@angular/compiler'); } - if (polyfills?.length) { + // Add Angular's global locale data if i18n options are present. + // Locale data should go first so that project provided polyfill code can augment if needed. + let needLocaleDataPlugin = false; + if (options.i18nOptions.shouldInline) { + // When inlining, a placeholder is used to allow the post-processing step to inject the $localize locale identifier + polyfills.unshift('angular:locale/placeholder'); + buildOptions.plugins?.unshift((0, virtual_module_plugin_1.createVirtualModulePlugin)({ + namespace: 'angular:locale/placeholder', + entryPointOnly: false, + loadContent: () => ({ + contents: `(globalThis.$localize ??= {}).locale = "___NG_LOCALE_INSERT___";\n`, + loader: 'js', + resolveDir: workspaceRoot, + }), + })); + // Add locale data for all active locales + // TODO: Inject each individually within the inlining process itself + for (const locale of options.i18nOptions.inlineLocales) { + polyfills.unshift(`angular:locale/data:${locale}`); + } + needLocaleDataPlugin = true; + } + else if (options.i18nOptions.hasDefinedSourceLocale) { + // When not inlining and a source local is present, use the source locale data directly + polyfills.unshift(`angular:locale/data:${options.i18nOptions.sourceLocale}`); + needLocaleDataPlugin = true; + } + if (needLocaleDataPlugin) { + buildOptions.plugins?.push((0, i18n_locale_plugin_1.createAngularLocaleDataPlugin)()); + } + // Add polyfill entry point if polyfills are present + if (polyfills.length) { const namespace = 'angular:polyfills'; buildOptions.entryPoints = { ...buildOptions.entryPoints, @@ -181,6 +215,16 @@ function createServerCodeBundleOptions(options, target, sourceFileCache) { exports.createServerCodeBundleOptions = createServerCodeBundleOptions; function getEsBuildCommonOptions(options) { const { workspaceRoot, outExtension, optimizationOptions, sourcemapOptions, tsconfig, externalDependencies, outputNames, preserveSymlinks, jit, } = options; + // Ensure unique hashes for i18n translation changes when using post-process inlining. + // This hash value is added as a footer to each file and ensures that the output file names (with hashes) + // change when translation files have changed. If this is not done the post processed files may have + // different content but would retain identical production file names which would lead to browser caching problems. + let footer; + if (options.i18nOptions.shouldInline) { + // Update file hashes to include translation file content + const i18nHash = Object.values(options.i18nOptions.locales).reduce((data, locale) => data + locale.files.map((file) => file.integrity || '').join('|'), ''); + footer = { js: `/**i18n:${(0, node_crypto_1.createHash)('sha256').update(i18nHash).digest('hex')}*/` }; + } return { absWorkingDir: workspaceRoot, bundle: true, @@ -211,6 +255,7 @@ function getEsBuildCommonOptions(options) { ...(optimizationOptions.scripts ? { 'ngDevMode': 'false' } : undefined), 'ngJitMode': jit ? 'true' : 'false', }, + footer, };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AgICAgICAgICBsb2FkZXI6ICdqcycsXG4gICAgICAgICAgcmVzb2x2ZURpcjogd29ya3NwYWNlUm9vdCxcbiAgICAgICAgfTtcbiAgICAgIH0sXG4gICAgfSksXG4gICk7XG5cbiAgaWYgKHNzckVudHJ5UG9pbnQpIHtcbiAgICBidWlsZE9wdGlvbnMucGx1Z2lucy5wdXNoKFxuICAgICAgY3JlYXRlVmlydHVhbE1vZHVsZVBsdWdpbih7XG4gICAgICAgIG5hbWVzcGFjZTogc3NyRW50cnlOYW1lc3BhY2UsXG4gICAgICAgIGxvYWRDb250ZW50OiAoKSA9PiB7XG4gICAgICAgICAgY29uc3Qgc2VydmVyRW50cnlQb2ludCA9IHJlbGF0aXZlKHdvcmtzcGFjZVJvb3QsIHNzckVudHJ5UG9pbnQpLnJlcGxhY2UoL1xcXFwvZywgJy8nKTtcblxuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBjb250ZW50czogW1xuICAgICAgICAgICAgICAuLi5wb2x5ZmlsbHMsXG4gICAgICAgICAgICAgIGBpbXBvcnQgJy4vJHtzZXJ2ZXJFbnRyeVBvaW50fSc7YCxcbiAgICAgICAgICAgICAgYGV4cG9ydCAqIGZyb20gJy4vJHtzZXJ2ZXJFbnRyeVBvaW50fSc7YCxcbiAgICAgICAgICAgIF0uam9pbignXFxuJyksXG4gICAgICAgICAgICBsb2FkZXI6ICdqcycsXG4gICAgICAgICAgICByZXNvbHZlRGlyOiB3b3Jrc3BhY2VSb290LFxuICAgICAgICAgIH07XG4gICAgICAgIH0sXG4gICAgICB9KSxcbiAgICApO1xuICB9XG5cbiAgcmV0dXJuIGJ1aWxkT3B0aW9ucztcbn1cblxuZnVuY3Rpb24gZ2V0RXNCdWlsZENvbW1vbk9wdGlvbnMob3B0aW9uczogTm9ybWFsaXplZEFwcGxpY2F0aW9uQnVpbGRPcHRpb25zKTogQnVpbGRPcHRpb25zIHtcbiAgY29uc3Qge1xuICAgIHdvcmtzcGFjZVJvb3QsXG4gIC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iR7b3V0RXh0ZW5zaW9ufWAgfSA6IHVuZGVmaW5lZCxcbiAgICBzb3VyY2VtYXA6IHNvdXJjZW1hcE9wdGlvbnMuc2NyaXB0cyAmJiAoc291cmNlbWFwT3B0aW9ucy5oaWRkZW4gPyAnZXh0ZXJuYWwnIDogdHJ1ZSksXG4gICAgc3BsaXR0aW5nOiB0cnVlLFxuICAgIGNodW5rTmFtZXM6ICdjaHVuay1baGFzaF0nLFxuICAgIHRzY29uZmlnLFxuICAgIGV4dGVybmFsOiBleHRlcm5hbERlcGVuZGVuY2llcyxcbiAgICB3cml0ZTogZmFsc2UsXG4gICAgcHJlc2VydmVTeW1saW5rcyxcbiAgICBkZWZpbmU6IHtcbiAgICAgIC8vIE9ubHkgc2V0IHRvIGZhbHNlIHdoZW4gc2NyaXB0IG9wdGltaXphdGlvbnMgYXJlIGVuYWJsZWQuIEl0IHNob3VsZCBub3QgYmUgc2V0IHRvIHRydWUgYmVjYXVzZVxuICAgICAgLy8gQW5ndWxhciB0dXJucyBgbmdEZXZNb2RlYCBpbnRvIGFuIG9iamVjdCBmb3IgZGV2ZWxvcG1lbnQgZGVidWdnaW5nIHB1cnBvc2VzIHdoZW4gbm90IGRlZmluZWRcbiAgICAgIC8vIHdoaWNoIGEgY29uc3RhbnQgdHJ1ZSB2YWx1ZSB3b3VsZCBicmVhay5cbiAgICAgIC4uLihvcHRpbWl6YXRpb25PcHRpb25zLnNjcmlwdHMgPyB7ICduZ0Rldk1vZGUnOiAnZmFsc2UnIH0gOiB1bmRlZmluZWQpLFxuICAgICAgJ25nSml0TW9kZSc6IGppdCA/ICd0cnVlJyA6ICdmYWxzZScsXG4gICAgfSxcbiAgfTtcbn1cbiJdfQ== \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbGljYXRpb24tY29kZS1idW5kbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8u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c6IHRydWUsXG4gICAgY2h1bmtOYW1lczogJ2NodW5rLVtoYXNoXScsXG4gICAgdHNjb25maWcsXG4gICAgZXh0ZXJuYWw6IGV4dGVybmFsRGVwZW5kZW5jaWVzLFxuICAgIHdyaXRlOiBmYWxzZSxcbiAgICBwcmVzZXJ2ZVN5bWxpbmtzLFxuICAgIGRlZmluZToge1xuICAgICAgLy8gT25seSBzZXQgdG8gZmFsc2Ugd2hlbiBzY3JpcHQgb3B0aW1pemF0aW9ucyBhcmUgZW5hYmxlZC4gSXQgc2hvdWxkIG5vdCBiZSBzZXQgdG8gdHJ1ZSBiZWNhdXNlXG4gICAgICAvLyBBbmd1bGFyIHR1cm5zIGBuZ0Rldk1vZGVgIGludG8gYW4gb2JqZWN0IGZvciBkZXZlbG9wbWVudCBkZWJ1Z2dpbmcgcHVycG9zZXMgd2hlbiBub3QgZGVmaW5lZFxuICAgICAgLy8gd2hpY2ggYSBjb25zdGFudCB0cnVlIHZhbHVlIHdvdWxkIGJyZWFrLlxuICAgICAgLi4uKG9wdGltaXphdGlvbk9wdGlvbnMuc2NyaXB0cyA/IHsgJ25nRGV2TW9kZSc6ICdmYWxzZScgfSA6IHVuZGVmaW5lZCksXG4gICAgICAnbmdKaXRNb2RlJzogaml0ID8gJ3RydWUnIDogJ2ZhbHNlJyxcbiAgICB9LFxuICAgIGZvb3RlcixcbiAgfTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/src/tools/esbuild/bundler-execution-result.d.ts b/src/tools/esbuild/bundler-execution-result.d.ts index 137e11fb..78d20a08 100644 --- a/src/tools/esbuild/bundler-execution-result.d.ts +++ b/src/tools/esbuild/bundler-execution-result.d.ts @@ -20,8 +20,8 @@ export interface RebuildState { export declare class ExecutionResult { private rebuildContexts; private codeBundleCache?; - readonly outputFiles: OutputFile[]; - readonly assetFiles: { + outputFiles: OutputFile[]; + assetFiles: { source: string; destination: string; }[]; diff --git a/src/tools/esbuild/bundler-execution-result.js b/src/tools/esbuild/bundler-execution-result.js index 3d4fcc30..739fe158 100644 --- a/src/tools/esbuild/bundler-execution-result.js +++ b/src/tools/esbuild/bundler-execution-result.js @@ -56,4 +56,4 @@ class ExecutionResult { } } exports.ExecutionResult = ExecutionResult; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlci1leGVjdXRpb24tcmVzdWx0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhcl9kZXZraXQvYnVpbGRfYW5ndWxhci9zcmMvdG9vbHMvZXNidWlsZC9idW5kbGVyLWV4ZWN1dGlvbi1yZXN1bHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBTUgsbUNBQW1EO0FBUW5EOztHQUVHO0FBQ0gsTUFBYSxlQUFlO0lBS2hCO0lBQ0E7SUFMRCxXQUFXLEdBQWlCLEVBQUUsQ0FBQztJQUMvQixVQUFVLEdBQThDLEVBQUUsQ0FBQztJQUVwRSxZQUNVLGVBQWlDLEVBQ2pDLGVBQWlDO1FBRGpDLG9CQUFlLEdBQWYsZUFBZSxDQUFrQjtRQUNqQyxvQkFBZSxHQUFmLGVBQWUsQ0FBa0I7SUFDeEMsQ0FBQztJQUVKLGFBQWEsQ0FBQyxJQUFZLEVBQUUsT0FBZTtRQUN6QyxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFBLGdDQUF3QixFQUFDLElBQUksRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDO0lBQ2pFLENBQUM7SUFFRCxJQUFJLE1BQU07UUFDUixPQUFPO1lBQ0wsT0FBTyxFQUFFLElBQUksQ0FBQyxXQUFXLENBQUMsTUFBTSxHQUFHLENBQUM7U0FDckMsQ0FBQztJQUNKLENBQUM7SUFFRCxJQUFJLGVBQWU7UUFDakIsT0FBTztZQUNMLE9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nRleHQpID0+IGNvbnRleHQuZGlzcG9zZSgpKSk7XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/src/tools/esbuild/i18n-inliner-worker.d.ts b/src/tools/esbuild/i18n-inliner-worker.d.ts new file mode 100644 index 00000000..4a63d427 --- /dev/null +++ b/src/tools/esbuild/i18n-inliner-worker.d.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * The options passed to the inliner for each file request + */ +interface InlineRequest { + /** + * The filename that should be processed. The data for the file is provided to the Worker + * during Worker initialization. + */ + filename: string; + /** + * The locale specifier that should be used during the inlining process of the file. + */ + locale: string; + /** + * The translation messages for the locale that should be used during the inlining process of the file. + */ + translation?: Record; +} +/** + * Inlines the provided locale and translation into a JavaScript file that contains `$localize` usage. + * This function is the main entry for the Worker's action that is called by the worker pool. + * + * @param request An InlineRequest object representing the options for inlining + * @returns An array containing the inlined file and optional map content. + */ +export default function inlineLocale(request: InlineRequest): Promise<{ + file: string; + contents: string; +}[]>; +export {}; diff --git a/src/tools/esbuild/i18n-inliner-worker.js b/src/tools/esbuild/i18n-inliner-worker.js new file mode 100644 index 00000000..589fbbd9 --- /dev/null +++ b/src/tools/esbuild/i18n-inliner-worker.js @@ -0,0 +1,138 @@ +"use strict"; +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const remapping_1 = __importDefault(require("@ampproject/remapping")); +const core_1 = require("@babel/core"); +const node_assert_1 = __importDefault(require("node:assert")); +const node_worker_threads_1 = require("node:worker_threads"); +const error_1 = require("../../utils/error"); +const load_esm_1 = require("../../utils/load-esm"); +// Extract the application files and common options used for inline requests from the Worker context +// TODO: Evaluate overall performance difference of passing translations here as well +const { files, missingTranslation, shouldOptimize } = (node_worker_threads_1.workerData || {}); +/** + * Inlines the provided locale and translation into a JavaScript file that contains `$localize` usage. + * This function is the main entry for the Worker's action that is called by the worker pool. + * + * @param request An InlineRequest object representing the options for inlining + * @returns An array containing the inlined file and optional map content. + */ +async function inlineLocale(request) { + const data = files.get(request.filename); + (0, node_assert_1.default)(data !== undefined, `Invalid inline request for file '${request.filename}'.`); + const code = await data.text(); + const map = await files.get(request.filename + '.map')?.text(); + const result = await transformWithBabel(code, map && JSON.parse(map), request); + // TODO: Return diagnostics + // TODO: Consider buffer transfer instead of string copying + const response = [{ file: request.filename, contents: result.code }]; + if (result.map) { + response.push({ file: request.filename + '.map', contents: result.map }); + } + return response; +} +exports.default = inlineLocale; +/** + * Cached instance of the `@angular/localize/tools` module. + * This is used to remove the need to repeatedly import the module per file translation. + */ +let localizeToolsModule; +/** + * Attempts to load the `@angular/localize/tools` module containing the functionality to + * perform the file translations. + * This module must be dynamically loaded as it is an ESM module and this file is CommonJS. + */ +async function loadLocalizeTools() { + // Load ESM `@angular/localize/tools` using the TypeScript dynamic import workaround. + // Once TypeScript provides support for keeping the dynamic import this workaround can be + // changed to a direct dynamic import. + localizeToolsModule ??= await (0, load_esm_1.loadEsmModule)('@angular/localize/tools'); + return localizeToolsModule; +} +/** + * Creates the needed Babel plugins to inline a given locale and translation for a JavaScript file. + * @param locale A string containing the locale specifier to use. + * @param translation A object record containing locale specific messages to use. + * @returns An array of Babel plugins. + */ +async function createI18nPlugins(locale, translation) { + const { Diagnostics, makeEs2015TranslatePlugin } = await loadLocalizeTools(); + const plugins = []; + const diagnostics = new Diagnostics(); + plugins.push( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + makeEs2015TranslatePlugin(diagnostics, (translation || {}), { + missingTranslation: translation === undefined ? 'ignore' : missingTranslation, + })); + // Create a plugin to replace the locale specifier constant inject by the build system with the actual specifier + plugins.push({ + visitor: { + StringLiteral(path) { + if (path.node.value === '___NG_LOCALE_INSERT___') { + path.replaceWith(core_1.types.stringLiteral(locale)); + } + }, + }, + }); + return { diagnostics, plugins }; +} +/** + * Transforms a JavaScript file using Babel to inline the request locale and translation. + * @param code A string containing the JavaScript code to transform. + * @param map A sourcemap object for the provided JavaScript code. + * @param options The inline request options to use. + * @returns An object containing the code, map, and diagnostics from the transformation. + */ +async function transformWithBabel(code, map, options) { + let ast; + try { + ast = (0, core_1.parseSync)(code, { + babelrc: false, + configFile: false, + sourceType: 'unambiguous', + filename: options.filename, + }); + } + catch (error) { + (0, error_1.assertIsError)(error); + // Make the error more readable. + // Same errors will contain the full content of the file as the error message + // Which makes it hard to find the actual error message. + const index = error.message.indexOf(')\n'); + const msg = index !== -1 ? error.message.slice(0, index + 1) : error.message; + throw new Error(`${msg}\nAn error occurred inlining file "${options.filename}"`); + } + if (!ast) { + throw new Error(`Unknown error occurred inlining file "${options.filename}"`); + } + const { diagnostics, plugins } = await createI18nPlugins(options.locale, options.translation); + const transformResult = await (0, core_1.transformFromAstAsync)(ast, code, { + filename: options.filename, + // false is a valid value but not included in the type definition + inputSourceMap: false, + sourceMaps: !!map, + compact: shouldOptimize, + configFile: false, + babelrc: false, + browserslistConfigFile: false, + plugins, + }); + if (!transformResult || !transformResult.code) { + throw new Error(`Unknown error occurred processing bundle for "${options.filename}".`); + } + let outputMap; + if (map && transformResult.map) { + outputMap = (0, remapping_1.default)([transformResult.map, map], () => null); + } + return { code: transformResult.code, map: outputMap && JSON.stringify(outputMap), diagnostics }; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaTE4bi1pbmxpbmVyLXdvcmtlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXJfZGV2a2l0L2J1aWxkX2FuZ3VsYXIvc3JjL3Rvb2xzL2VzYnVpbGQvaTE4bi1pb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0TWFwICYmIEpTT04uc3RyaW5naWZ5KG91dHB1dE1hcCksIGRpYWdub3N0aWNzIH07XG59XG4iXX0= \ No newline at end of file diff --git a/src/tools/esbuild/i18n-inliner.d.ts b/src/tools/esbuild/i18n-inliner.d.ts new file mode 100644 index 00000000..7c88245a --- /dev/null +++ b/src/tools/esbuild/i18n-inliner.d.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import type { OutputFile } from 'esbuild'; +/** + * Inlining options that should apply to all transformed code. + */ +export interface I18nInlinerOptions { + missingTranslation: 'error' | 'warning' | 'ignore'; + outputFiles: OutputFile[]; + shouldOptimize?: boolean; +} +/** + * A class that performs i18n translation inlining of JavaScript code. + * A worker pool is used to distribute the transformation actions and allow + * parallel processing. Inlining is only performed on code that contains the + * localize function (`$localize`). + */ +export declare class I18nInliner { + #private; + constructor(options: I18nInlinerOptions, maxThreads?: number); + /** + * Performs inlining of translations for the provided locale and translations. The files that + * are processed originate from the files passed to the class constructor and filter by presence + * of the localize function keyword. + * @param locale The string representing the locale to inline. + * @param translation The translation messages to use when inlining. + * @returns A promise that resolves to an array of OutputFiles representing a translated result. + */ + inlineForLocale(locale: string, translation: Record | undefined): Promise; + /** + * Stops all active transformation tasks and shuts down all workers. + * @returns A void promise that resolves when closing is complete. + */ + close(): Promise; +} diff --git a/src/tools/esbuild/i18n-inliner.js b/src/tools/esbuild/i18n-inliner.js new file mode 100644 index 00000000..cca9c4b5 --- /dev/null +++ b/src/tools/esbuild/i18n-inliner.js @@ -0,0 +1,119 @@ +"use strict"; +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.I18nInliner = void 0; +const piscina_1 = __importDefault(require("piscina")); +const utils_1 = require("./utils"); +/** + * A keyword used to indicate if a JavaScript file may require inlining of translations. + * This keyword is used to avoid processing files that would not otherwise need i18n processing. + */ +const LOCALIZE_KEYWORD = '$localize'; +/** + * A class that performs i18n translation inlining of JavaScript code. + * A worker pool is used to distribute the transformation actions and allow + * parallel processing. Inlining is only performed on code that contains the + * localize function (`$localize`). + */ +class I18nInliner { + #workerPool; + #localizeFiles; + #unmodifiedFiles; + constructor(options, maxThreads) { + this.#unmodifiedFiles = []; + const files = new Map(); + const pendingMaps = []; + for (const file of options.outputFiles) { + if (file.path.endsWith('.js')) { + // Check if localizations are present + const contentBuffer = Buffer.isBuffer(file.contents) + ? file.contents + : Buffer.from(file.contents.buffer, file.contents.byteOffset, file.contents.byteLength); + const hasLocalize = contentBuffer.includes(LOCALIZE_KEYWORD); + if (hasLocalize) { + // A Blob is an immutable data structure that allows sharing the data between workers + // without copying until the data is actually used within a Worker. This is useful here + // since each file may not actually be processed in each Worker and the Blob avoids + // unneeded repeat copying of potentially large JavaScript files. + files.set(file.path, new Blob([file.contents])); + continue; + } + } + else if (file.path.endsWith('.js.map')) { + // The related JS file may not have been checked yet. To ensure that map files are not + // missed, store any pending map files and check them after all output files. + pendingMaps.push(file); + continue; + } + this.#unmodifiedFiles.push(file); + } + // Check if any pending map files should be processed by checking if the parent JS file is present + for (const file of pendingMaps) { + if (files.has(file.path.slice(0, -4))) { + files.set(file.path, new Blob([file.contents])); + } + else { + this.#unmodifiedFiles.push(file); + } + } + this.#localizeFiles = files; + this.#workerPool = new piscina_1.default({ + filename: require.resolve('./i18n-inliner-worker'), + maxThreads, + // Extract options to ensure only the named options are serialized and sent to the worker + workerData: { + missingTranslation: options.missingTranslation, + shouldOptimize: options.shouldOptimize, + files, + }, + }); + } + /** + * Performs inlining of translations for the provided locale and translations. The files that + * are processed originate from the files passed to the class constructor and filter by presence + * of the localize function keyword. + * @param locale The string representing the locale to inline. + * @param translation The translation messages to use when inlining. + * @returns A promise that resolves to an array of OutputFiles representing a translated result. + */ + async inlineForLocale(locale, translation) { + // Request inlining for each file that contains localize calls + const requests = []; + for (const filename of this.#localizeFiles.keys()) { + if (filename.endsWith('.map')) { + continue; + } + const fileRequest = this.#workerPool.run({ + filename, + locale, + translation, + }); + requests.push(fileRequest); + } + // Wait for all file requests to complete + const rawResults = await Promise.all(requests); + // Convert raw results to output file objects and include all unmodified files + return [ + ...rawResults.flat().map(({ file, contents }) => (0, utils_1.createOutputFileFromData)(file, contents)), + ...this.#unmodifiedFiles.map((file) => (0, utils_1.cloneOutputFile)(file)), + ]; + } + /** + * Stops all active transformation tasks and shuts down all workers. + * @returns A void promise that resolves when closing is complete. + */ + close() { + return this.#workerPool.destroy(); + } +} +exports.I18nInliner = I18nInliner; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaTE4bi1pbmxpbmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhcl9kZXZraXQvYnVpbGRfYW5ndWxhci9zcmMvdG9vbHMvZXNidWlsZC9pMThuLWlubGluZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7Ozs7O0FBR0gsc0RBQThCO0FBQzlCLG1DQUFvRTtBQUVwRTs7O0dBR0c7QUFDSCxNQUFNLGdCQUFnQixHQUFHLFdBQVcsQ0FBQztBQVdyQzs7Ozs7R0FLRztBQUNILE1BQWEsV0FBVztJQUN0QixXQUFXLENBQVU7SUFDWixjQUFjLENBQTRCO0lBQzFDLGdCQUFnQixDQUFvQjtJQUU3QyxZQUFZLE9BQTJCLEVBQUUsVUFBbUI7UUFDMUQsSUFBSSxDQUFDLGdCQUFnQixHQUFHLEVBQUUsQ0FBQztRQUUzQixNQUFNLEtBQUssR0FBRyxJQUFJLEdBQUcsRUFBZ0IsQ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ZXRlLlxuICAgKi9cbiAgY2xvc2UoKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgcmV0dXJuIHRoaXMuI3dvcmtlclBvb2wuZGVzdHJveSgpO1xuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/src/tools/esbuild/i18n-locale-plugin.d.ts b/src/tools/esbuild/i18n-locale-plugin.d.ts new file mode 100644 index 00000000..6a5110dd --- /dev/null +++ b/src/tools/esbuild/i18n-locale-plugin.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import type { Plugin } from 'esbuild'; +/** + * The base module location used to search for locale specific data. + */ +export declare const LOCALE_DATA_BASE_MODULE = "@angular/common/locales/global"; +/** + * Creates an esbuild plugin that resolves Angular locale data files from `@angular/common`. + * + * @returns An esbuild plugin. + */ +export declare function createAngularLocaleDataPlugin(): Plugin; diff --git a/src/tools/esbuild/i18n-locale-plugin.js b/src/tools/esbuild/i18n-locale-plugin.js new file mode 100644 index 00000000..6d9ac66d --- /dev/null +++ b/src/tools/esbuild/i18n-locale-plugin.js @@ -0,0 +1,91 @@ +"use strict"; +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createAngularLocaleDataPlugin = exports.LOCALE_DATA_BASE_MODULE = void 0; +/** + * The base module location used to search for locale specific data. + */ +exports.LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global'; +/** + * Creates an esbuild plugin that resolves Angular locale data files from `@angular/common`. + * + * @returns An esbuild plugin. + */ +function createAngularLocaleDataPlugin() { + return { + name: 'angular-locale-data', + setup(build) { + // If packages are configured to be external then leave the original angular locale import path. + // This happens when using the development server with caching enabled to allow Vite prebundling to work. + // There currently is no option on the esbuild resolve function to resolve while disabling the option. To + // workaround the inability to resolve the full locale location here, the Vite dev server prebundling also + // contains a plugin to allow the locales to be correctly resolved when prebundling. + // NOTE: If esbuild eventually allows controlling the external package options in a build.resolve call, this + // workaround can be removed. + if (build.initialOptions.packages === 'external') { + return; + } + build.onResolve({ filter: /^angular:locale\/data:/ }, async ({ path }) => { + // Extract the locale from the path + const originalLocale = path.split(':', 3)[2]; + // Remove any private subtags since these will never match + let partialLocale = originalLocale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, ''); + let exact = true; + while (partialLocale) { + const potentialPath = `${exports.LOCALE_DATA_BASE_MODULE}/${partialLocale}`; + const result = await build.resolve(potentialPath, { + kind: 'import-statement', + resolveDir: build.initialOptions.absWorkingDir, + }); + if (result.path) { + if (exact) { + return result; + } + else { + return { + ...result, + warnings: [ + ...result.warnings, + { + location: null, + text: `Locale data for '${originalLocale}' cannot be found. Using locale data for '${partialLocale}'.`, + }, + ], + }; + } + } + // Remove the last subtag and try again with a less specific locale + const parts = partialLocale.split('-'); + partialLocale = parts.slice(0, -1).join('-'); + exact = false; + // The locales "en" and "en-US" are considered exact to retain existing behavior + if (originalLocale === 'en-US' && partialLocale === 'en') { + exact = true; + } + } + // Not found so issue a warning and use an empty loader. Framework built-in `en-US` data will be used. + // This retains existing behavior as in the Webpack-based builder. + return { + path: originalLocale, + namespace: 'angular:locale/data', + warnings: [ + { + location: null, + text: `Locale data for '${originalLocale}' cannot be found. No locale data will be included for this locale.`, + }, + ], + }; + }); + // Locales that cannot be found will be loaded as empty content with a warning from the resolve step + build.onLoad({ filter: /./, namespace: 'angular:locale/data' }, () => ({ loader: 'empty' })); + }, + }; +} +exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaTE4bi1sb2NhbGUtcGx1Z2luLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhcl9kZ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I6IGJ1aWxkLmluaXRpYWxPcHRpb25zLmFic1dvcmtpbmdEaXIsXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgaWYgKHJlc3VsdC5wYXRoKSB7XG4gICAgICAgICAgICBpZiAoZXhhY3QpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgLi4ucmVzdWx0LFxuICAgICAgICAgICAgICAgIHdhcm5pbmdzOiBbXG4gICAgICAgICAgICAgICAgICAuLi5yZXN1bHQud2FybmluZ3MsXG4gICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiBgTG9jYWxlIGRhdGEgZm9yICcke29yaWdpbmFsTG9jYWxlfScgY2Fubm90IGJlIGZvdW5kLiBVc2luZyBsb2NhbGUgZGF0YSBmb3IgJyR7cGFydGlhbExvY2FsZX0nLmAsXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gUmVtb3ZlIHRoZSBsYXN0IHN1YnRhZyBhbmQgdHJ5IGFnYWluIHdpdGggYSBsZXNzIHNwZWNpZmljIGxvY2FsZVxuICAgICAgICAgIGNvbnN0IHBhcnRzID0gcGFydGlhbExvY2FsZS5zcGxpdCgnLScpO1xuICAgICAgICAgIHBhcnRpYWxMb2NhbGUgPSBwYXJ0cy5zbGljZSgwLCAtMSkuam9pbignLScpO1xuICAgICAgICAgIGV4YWN0ID0gZmFsc2U7XG4gICAgICAgICAgLy8gVGhlIGxvY2FsZXMgXCJlblwiIGFuZCBcImVuLVVTXCIgYXJlIGNvbnNpZGVyZWQgZXhhY3QgdG8gcmV0YWluIGV4aXN0aW5nIGJlaG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I6bG9jYWxlL2RhdGEnIH0sICgpID0+ICh7IGxvYWRlcjogJ2VtcHR5JyB9KSk7XG4gICAgfSxcbiAgfTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/src/tools/esbuild/index-html-generator.d.ts b/src/tools/esbuild/index-html-generator.d.ts index 426033de..273b2be2 100644 --- a/src/tools/esbuild/index-html-generator.d.ts +++ b/src/tools/esbuild/index-html-generator.d.ts @@ -5,10 +5,10 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ +import type { OutputFile } from 'esbuild'; import { NormalizedApplicationBuildOptions } from '../../builders/application/options'; import { InitialFileRecord } from './bundler-context'; -import type { ExecutionResult } from './bundler-execution-result'; -export declare function generateIndexHtml(initialFiles: Map, executionResult: ExecutionResult, buildOptions: NormalizedApplicationBuildOptions): Promise<{ +export declare function generateIndexHtml(initialFiles: Map, outputFiles: OutputFile[], buildOptions: NormalizedApplicationBuildOptions, lang?: string): Promise<{ content: string; contentWithoutCriticalCssInlined: string; warnings: string[]; diff --git a/src/tools/esbuild/index-html-generator.js b/src/tools/esbuild/index-html-generator.js index d81f96fb..0fbbaf30 100644 --- a/src/tools/esbuild/index-html-generator.js +++ b/src/tools/esbuild/index-html-generator.js @@ -15,7 +15,7 @@ const node_assert_1 = __importDefault(require("node:assert")); const node_path_1 = __importDefault(require("node:path")); const index_html_generator_1 = require("../../utils/index-file/index-html-generator"); const inline_critical_css_1 = require("../../utils/index-file/inline-critical-css"); -async function generateIndexHtml(initialFiles, executionResult, buildOptions) { +async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang) { // Analyze metafile for initial link-based hints. // Skip if the internal externalPackages option is enabled since this option requires // dev server cooperation to properly resolve and fetch imports. @@ -43,7 +43,7 @@ async function generateIndexHtml(initialFiles, executionResult, buildOptions) { const readAsset = async function (filePath) { // Remove leading directory separator const relativefilePath = node_path_1.default.relative(virtualOutputPath, filePath); - const file = executionResult.outputFiles.find((file) => file.path === relativefilePath); + const file = outputFiles.find((file) => file.path === relativefilePath); if (file) { return file.text; } @@ -66,7 +66,7 @@ async function generateIndexHtml(initialFiles, executionResult, buildOptions) { indexHtmlGenerator.readAsset = readAsset; const transformResult = await indexHtmlGenerator.process({ baseHref, - lang: undefined, + lang, outputPath: virtualOutputPath, files: [...initialFiles].map(([file, record]) => ({ name: record.name ?? '', @@ -97,4 +97,4 @@ async function generateIndexHtml(initialFiles, executionResult, buildOptions) { }; } exports.generateIndexHtml = generateIndexHtml; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgtaHRtbC1nZW5lcmF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyX2RldmtpdC9idWlsZF9hbmd1bGFyL3NyYy90b29scy9lc2J1aWxkL2luZGV4LWh0bWwtZ2VuZXJhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7O0dBTUc7Ozs7OztBQUVILDhEQUFpQztBQUNqQywwREFBNkI7QUFFN0Isc0ZBQWlGO0FBQ2pGLG9GQUF3RjtBQUlqRixLQUFLLFVBQVUsaUJBQWlCLENBQ3JDLFlBQTRDLEVBQzVDLGVBQWdDLEVBQ2hDLFlBQStDO0lBTy9DLGlEQUFpRDtJQUNqRCxxRkFBcUY7SUFDckYsZ0VBQWdFO0lBQ2hFLE1BQU0sS0FBSyxHQUFHLEVBQUUsQ0FBQztJQUNqQixNQUFNLEVBQ0osZ0JBQWdCLEVBQ2hCLGdCQUFnQixFQUNoQixtQkFBbUIsRUFDbkIsV0FBVyxFQUNYLG9CQUFvQixFQUNwQixRQUFRLEdBQ1QsR0FBRyxZQUFZLENBQUM7SUFFakIsSUFBQSxxQkFBTSxFQUFDLGdCQUFnQixFQUFFLHVDQUF1QyxDQUFDLENBQUM7SUFFbEUsSUFBSSxDQUFDLGd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ZW50O1xuICBpZiAoIW9wdGltaXphdGlvbk9wdGlvbnMuc3R5bGVzLmlubGluZUNyaXRpY2FsKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIC4uLnRyYW5zZm9ybVJlc3VsdCxcbiAgICAgIGNvbnRlbnRXaXRob3V0Q3JpdGljYWxDc3NJbmxpbmVkLFxuICAgIH07XG4gIH1cblxuICBjb25zdCBpbmxpbmVDcml0aWNhbENzc1Byb2Nlc3NvciA9IG5ldyBJbmxpbmVDcml0aWNhbENzc1Byb2Nlc3Nvcih7XG4gICAgbWluaWZ5OiBmYWxzZSwgLy8gQ1NTIGhhcyBhbHJlYWR5IGJlZW4gbWluaWZpZWQgZHVyaW5nIHRoZSBidWlsZC5cbiAgICByZWFkQXNzZXQsXG4gIH0pO1xuXG4gIGNvbnN0IHsgY29udGVudCwgZXJyb3JzLCB3YXJuaW5ncyB9ID0gYXdhaXQgaW5saW5lQ3JpdGljYWxDc3NQcm9jZXNzb3IucHJvY2VzcyhcbiAgICBjb250ZW50V2l0aG91dENyaXRpY2FsQ3NzSW5saW5lZCxcbiAgICB7XG4gICAgICBvdXRwdXRQYXRoOiB2aXJ0dWFsT3V0cHV0UGF0aCxcbiAgICB9LFxuICApO1xuXG4gIHJldHVybiB7XG4gICAgZXJyb3JzOiBbLi4udHJhbnNmb3JtUmVzdWx0LmVycm9ycywgLi4uZXJyb3JzXSxcbiAgICB3YXJuaW5nczogWy4uLnRyYW5zZm9ybVJlc3VsdC53YXJuaW5ncywgLi4ud2FybmluZ3NdLFxuICAgIGNvbnRlbnQsXG4gICAgY29udGVudFdpdGhvdXRDcml0aWNhbENzc0lubGluZWQsXG4gIH07XG59XG4iXX0= \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgtaHRtbC1nZW5lcmF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8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ybmluZ3MgfSA9IGF3YWl0IGlubGluZUNyaXRpY2FsQ3NzUHJvY2Vzc29yLnByb2Nlc3MoXG4gICAgY29udGVudFdpdGhvdXRDcml0aWNhbENzc0lubGluZWQsXG4gICAge1xuICAgICAgb3V0cHV0UGF0aDogdmlydHVhbE91dHB1dFBhdGgsXG4gICAgfSxcbiAgKTtcblxuICByZXR1cm4ge1xuICAgIGVycm9yczogWy4uLnRyYW5zZm9ybVJlc3VsdC5lcnJvcnMsIC4uLmVycm9yc10sXG4gICAgd2FybmluZ3M6IFsuLi50cmFuc2Zvcm1SZXN1bHQud2FybmluZ3MsIC4uLndhcm5pbmdzXSxcbiAgICBjb250ZW50LFxuICAgIGNvbnRlbnRXaXRob3V0Q3JpdGljYWxDc3NJbmxpbmVkLFxuICB9O1xufVxuIl19 \ No newline at end of file diff --git a/src/tools/esbuild/utils.d.ts b/src/tools/esbuild/utils.d.ts index 3da9613c..a2ee54bf 100644 --- a/src/tools/esbuild/utils.d.ts +++ b/src/tools/esbuild/utils.d.ts @@ -28,6 +28,8 @@ export declare function writeResultFiles(outputFiles: OutputFile[], assetFiles: destination: string; }[] | undefined, outputPath: string): Promise; export declare function createOutputFileFromText(path: string, text: string): OutputFile; +export declare function createOutputFileFromData(path: string, data: Uint8Array): OutputFile; +export declare function cloneOutputFile(file: OutputFile): OutputFile; /** * Transform browserlists result to esbuild target. * @see https://esbuild.github.io/api/#target diff --git a/src/tools/esbuild/utils.js b/src/tools/esbuild/utils.js index 8aefcc66..b91c2709 100644 --- a/src/tools/esbuild/utils.js +++ b/src/tools/esbuild/utils.js @@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.transformSupportedBrowsersToTargets = exports.createOutputFileFromText = exports.writeResultFiles = exports.getFeatureSupport = exports.logMessages = exports.withNoProgress = exports.withSpinner = exports.calculateEstimatedTransferSizes = exports.logBuildStats = void 0; +exports.transformSupportedBrowsersToTargets = exports.cloneOutputFile = exports.createOutputFileFromData = exports.createOutputFileFromText = exports.writeResultFiles = exports.getFeatureSupport = exports.logMessages = exports.withNoProgress = exports.withSpinner = exports.calculateEstimatedTransferSizes = exports.logBuildStats = void 0; const esbuild_1 = require("esbuild"); const node_crypto_1 = require("node:crypto"); const node_fs_1 = require("node:fs"); @@ -180,6 +180,38 @@ function createOutputFileFromText(path, text) { }; } exports.createOutputFileFromText = createOutputFileFromText; +function createOutputFileFromData(path, data) { + return { + path, + get text() { + return Buffer.from(data.buffer, data.byteOffset, data.byteLength).toString('utf-8'); + }, + get hash() { + return (0, node_crypto_1.createHash)('sha256').update(data).digest('hex'); + }, + get contents() { + return data; + }, + }; +} +exports.createOutputFileFromData = createOutputFileFromData; +function cloneOutputFile(file) { + const path = file.path; + const data = file.contents; + return { + path, + get text() { + return Buffer.from(data.buffer, data.byteOffset, data.byteLength).toString('utf-8'); + }, + get hash() { + return (0, node_crypto_1.createHash)('sha256').update(data).digest('hex'); + }, + get contents() { + return data; + }, + }; +} +exports.cloneOutputFile = cloneOutputFile; /** * Transform browserlists result to esbuild target. * @see https://esbuild.github.io/api/#target @@ -224,4 +256,4 @@ function transformSupportedBrowsersToTargets(supportedBrowsers) { return transformed; } exports.transformSupportedBrowsersToTargets = transformSupportedBrowsersToTargets; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyX2RldmtpdC9idWlsZF9hbmd1bGFyL3NyYy90b29scy9lc2J1aWxkL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7O0dBTUc7Ozs7OztBQUdILHFDQUE2RjtBQUM3Riw2Q0FBeUM7QUFDekMscUNBQW1EO0FBQ25ELG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mVhdHVyZXMuXG4gICAgICAgIHZlcnNpb24gPSAnOTk5JztcbiAgICAgIH0gZWxzZSBpZiAoIXZlcnNpb24uaW5jbHVkZXMoJy4nKSkge1xuICAgICAgICAvLyBBIGxvbmUgbWFqb3IgdmVyc2lvbiBpcyBjb25zaWRlcmVkIGJ5IGVzYnVpbGQgdG8gaW5jbHVkZSBhbGwgbWlub3IgdmVyc2lvbnMuIEhvd2V2ZXIsXG4gICAgICAgIC8vIGJyb3dzZXJzbGlzdCBkb2VzIG5vdCBhbmQgaXMgYWxzbyBpbmNvbnNpc3RlbnQgaW4gaXRzIGAuMGAgdmVyc2lvbiBuYW1pbmcuIEZvciBleGFtcGxlLFxuICAgICAgICAvLyBTYWZhcmkgMTUuMCBpcyBuYW1lZCBgc2FmYXJpIDE1YCBidXQgU2FmYXJpIDE2LjAgaXMgbmFtZWQgYHNhZmFyaSAxNi4wYC5cbiAgICAgICAgdmVyc2lvbiArPSAnLjAnO1xuICAgICAgfVxuXG4gICAgICB0cmFuc2Zvcm1lZC5wdXNoKGJyb3dzZXJOYW1lICsgdmVyc2lvbik7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRyYW5zZm9ybWVkO1xufVxuIl19 \ No newline at end of file diff --git a/src/tools/esbuild/virtual-module-plugin.d.ts b/src/tools/esbuild/virtual-module-plugin.d.ts index ee6d5b03..80840580 100644 --- a/src/tools/esbuild/virtual-module-plugin.d.ts +++ b/src/tools/esbuild/virtual-module-plugin.d.ts @@ -19,6 +19,8 @@ export interface VirtualModulePluginOptions { transformPath?: (path: string) => string; /** Method to provide the module content. */ loadContent: (args: OnLoadArgs, build: PluginBuild) => ReturnType[1]>; + /** Restrict to only entry points. Defaults to `true`. */ + entryPointOnly?: boolean; } /** * Creates an esbuild plugin that generated virtual modules. diff --git a/src/tools/esbuild/virtual-module-plugin.js b/src/tools/esbuild/virtual-module-plugin.js index f8a9b433..9fa023df 100644 --- a/src/tools/esbuild/virtual-module-plugin.js +++ b/src/tools/esbuild/virtual-module-plugin.js @@ -14,12 +14,12 @@ exports.createVirtualModulePlugin = void 0; * @returns An esbuild plugin. */ function createVirtualModulePlugin(options) { - const { namespace, external, transformPath: pathTransformer, loadContent } = options; + const { namespace, external, transformPath: pathTransformer, loadContent, entryPointOnly = true, } = options; return { name: namespace.replace(/[/:]/g, '-'), setup(build) { build.onResolve({ filter: new RegExp('^' + namespace) }, ({ kind, path }) => { - if (kind !== 'entry-point') { + if (entryPointOnly && kind !== 'entry-point') { return null; } return { @@ -40,4 +40,4 @@ function createVirtualModulePlugin(options) { }; } exports.createVirtualModulePlugin = createVirtualModulePlugin; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlydHVhbC1tb2R1bGUtcGx1Z2luLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhcl9kZXZraXQvYnVpbGRfYW5ndWxhci9zcmMvdG9vbHMvZXNidWlsZC92aXJ0dWFsLW1vZHVsZS1wbHVnaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBc0JIOzs7O0dBSUc7QUFDSCxTQUFnQix5QkFBeUIsQ0FBQyxPQUFtQztJQUMzRSxNQUFNLEVBQUUsU0FBUyxFQUFFLFFBQVEsRUFBRSxhQUFhLEVBQUUsZUFBZSxFQUFFLFdBQVcsRUFBRSxHQUFHLE9BQU8sQ0FBQztJQUVyRixPQUFPO1FBQ0wsSUFBSSxFQUFFLFNBQVMsQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFLEdBQUcsQ0FBQztRQUNyQyxLQUFLLENBQUMsS0FBSztZQUNULEtBQUssQ0FBQyxTQUFTLENBQUMsRUFBRSxNQUFNLEVBQUUsSUFBSSxNQUFNLENBQUMsR0FBRyxHQUFHLFNBQVMsQ0FBQyxFQUFFLEVBQUUs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sTW9kdWxlUGx1Z2luKG9wdGlvbnM6IFZpcnR1YWxNb2R1bGVQbHVnaW5PcHRpb25zKTogUGx1Z2luIHtcbiAgY29uc3QgeyBuYW1lc3BhY2UsIGV4dGVybmFsLCB0cmFuc2Zvcm1QYXRoOiBwYXRoVHJhbnNmb3JtZXIsIGxvYWRDb250ZW50IH0gPSBvcHRpb25zO1xuXG4gIHJldHVybiB7XG4gICAgbmFtZTogbmFtZXNwYWNlLnJlcGxhY2UoL1svOl0vZywgJy0nKSxcbiAgICBzZXR1cChidWlsZCk6IHZvaWQge1xuICAgICAgYnVpbGQub25SZXNvbHZlKHsgZmlsdGVyOiBuZXcgUmVnRXhwKCdeJyArIG5hbWVzcGFjZSkgfSwgKHsga2luZCwgcGF0aCB9KSA9PiB7XG4gICAgICAgIGlmIChraW5kICE9PSAnZW50cnktcG9pbnQnKSB7XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHBhdGg6IHBhdGhUcmFuc2Zvcm1lcj8uKHBhdGgpID8/IHBhdGgsXG4gICAgICAgICAgbmFtZXNwYWNlLFxuICAgICAgICB9O1xuICAgICAgfSk7XG5cbiAgICAgIGlmIChleHRlcm5hbCkge1xuICAgICAgICBidWlsZC5vblJlc29sdmUoeyBmaWx0ZXI6IC8uLywgbmFtZXNwYWNlIH0sICh7IHBhdGggfSkgPT4ge1xuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBwYXRoLFxuICAgICAgICAgICAgZXh0ZXJuYWw6IHRydWUsXG4gICAgICAgICAgfTtcbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIGJ1aWxkLm9uTG9hZCh7IGZpbHRlcjogLy4vLCBuYW1lc3BhY2UgfSwgKGFyZ3MpID0+IGxvYWRDb250ZW50KGFyZ3MsIGJ1aWxkKSk7XG4gICAgfSxcbiAgfTtcbn1cbiJdfQ== \ No newline at end of file +//# sourceMappingURL=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FxuICAgIGVudHJ5UG9pbnRPbmx5ID0gdHJ1ZSxcbiAgfSA9IG9wdGlvbnM7XG5cbiAgcmV0dXJuIHtcbiAgICBuYW1lOiBuYW1lc3BhY2UucmVwbGFjZSgvWy86XS9nLCAnLScpLFxuICAgIHNldHVwKGJ1aWxkKTogdm9pZCB7XG4gICAgICBidWlsZC5vblJlc29sdmUoeyBmaWx0ZXI6IG5ldyBSZWdFeHAoJ14nICsgbmFtZXNwYWNlKSB9LCAoeyBraW5kLCBwYXRoIH0pID0+IHtcbiAgICAgICAgaWYgKGVudHJ5UG9pbnRPbmx5ICYmIGtpbmQgIT09ICdlbnRyeS1wb2ludCcpIHtcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgcGF0aDogcGF0aFRyYW5zZm9ybWVyPy4ocGF0aCkgPz8gcGF0aCxcbiAgICAgICAgICBuYW1lc3BhY2UsXG4gICAgICAgIH07XG4gICAgICB9KTtcblxuICAgICAgaWYgKGV4dGVybmFsKSB7XG4gICAgICAgIGJ1aWxkLm9uUmVzb2x2ZSh7IGZpbHRlcjogLy4vLCBuYW1lc3BhY2UgfSwgKHsgcGF0aCB9KSA9PiB7XG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICBleHRlcm5hbDogdHJ1ZSxcbiAgICAgICAgICB9O1xuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgYnVpbGQub25Mb2FkKHsgZmlsdGVyOiAvLi8sIG5hbWVzcGFjZSB9LCAoYXJncykgPT4gbG9hZENvbnRlbnQoYXJncywgYnVpbGQpKTtcbiAgICB9LFxuICB9O1xufVxuIl19 \ No newline at end of file diff --git a/src/tools/vite/i18n-locale-plugin.d.ts b/src/tools/vite/i18n-locale-plugin.d.ts new file mode 100644 index 00000000..09df59cc --- /dev/null +++ b/src/tools/vite/i18n-locale-plugin.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import type { Plugin } from 'vite'; +/** + * The base module location used to search for locale specific data. + */ +export declare const LOCALE_DATA_BASE_MODULE = "@angular/common/locales/global"; +/** + * Creates a Vite plugin that resolves Angular locale data files from `@angular/common`. + * + * @returns A Vite plugin. + */ +export declare function createAngularLocaleDataPlugin(): Plugin; diff --git a/src/tools/vite/i18n-locale-plugin.js b/src/tools/vite/i18n-locale-plugin.js new file mode 100644 index 00000000..ae7e8534 --- /dev/null +++ b/src/tools/vite/i18n-locale-plugin.js @@ -0,0 +1,56 @@ +"use strict"; +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createAngularLocaleDataPlugin = exports.LOCALE_DATA_BASE_MODULE = void 0; +/** + * The base module location used to search for locale specific data. + */ +exports.LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global'; +/** + * Creates a Vite plugin that resolves Angular locale data files from `@angular/common`. + * + * @returns A Vite plugin. + */ +function createAngularLocaleDataPlugin() { + return { + name: 'angular-locale-data', + enforce: 'pre', + async resolveId(source) { + if (!source.startsWith('angular:locale/data:')) { + return; + } + // Extract the locale from the path + const originalLocale = source.split(':', 3)[2]; + // Remove any private subtags since these will never match + let partialLocale = originalLocale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, ''); + let exact = true; + while (partialLocale) { + const potentialPath = `${exports.LOCALE_DATA_BASE_MODULE}/${partialLocale}`; + const result = await this.resolve(potentialPath); + if (result) { + if (!exact) { + this.warn(`Locale data for '${originalLocale}' cannot be found. Using locale data for '${partialLocale}'.`); + } + return result; + } + // Remove the last subtag and try again with a less specific locale + const parts = partialLocale.split('-'); + partialLocale = parts.slice(0, -1).join('-'); + exact = false; + // The locales "en" and "en-US" are considered exact to retain existing behavior + if (originalLocale === 'en-US' && partialLocale === 'en') { + exact = true; + } + } + return null; + }, + }; +} +exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaTE4bi1sb2NhbGUtcGx1Z2luLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhcl9kZXZraXQvYnVpbGRfYW5ndWxhci9zcmMvdG9vbHMvdml0ZS9pMThuLWxvY2FsZS1wbHVnaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBSUg7O0dBRUc7QUFDVSxRQUFBLHVCQUF1QixHQUFHLGdDQUFnQyxDQUFDO0FBRXhFOzs7O0dBSUc7QUFDSCxTQUFnQiw2QkFBNkI7SUFDM0MsT0FBTztRQUNMLElBQUksRUFBRSxxQkFBcUI7UUFDM0IsT0FBTyxFQUFFLEtBQUs7UUFDZCxLQUFLLENBQUMsU0FBUyxDQUFDLE1BQU07WUFDcEIsSUFBSSxDQUFDLE1BQU0sQ0FBQyxVQUFVLENBQUMsc0JBQXNCLENBQUMsRUFBRTtnQkFDOUMsT0FBTzthQUNSO1lBRUQsbUNBQW1DO1lBQ25DLE1BQU0sY0FBYyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBRS9DLDBEQUEwRDtZQUMxRCxJQUFJLGFBQWEsR0FBRyxjQUFjLENBQUMsT0FBTyxDQUFDLHlCQUF5QixFQUFFLEVBQUUsQ0FBQyxDQUFDO1lBRTFFLElBQUksS0FBSyxHQUFHLElBQUksQ0FBQztZQUNqQixPQUFPLGFBQWEsRUFBRTtnQkFDcEIsTUFBTSxhQUFhLEdBQUcsR0FBRywrQkFBdUIs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AnZW4tVVMnICYmIHBhcnRpYWxMb2NhbGUgPT09ICdlbicpIHtcbiAgICAgICAgICBleGFjdCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgcmV0dXJuIG51bGw7XG4gICAgfSxcbiAgfTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/uniqueId b/uniqueId index 8069f5d6..f831540a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Sep 21 2023 14:20:08 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Sep 22 2023 08:56:27 GMT+0000 (Coordinated Universal Time) \ No newline at end of file