diff --git a/packages/angular_devkit/build_angular/src/utils/action-executor.ts b/packages/angular_devkit/build_angular/src/utils/action-executor.ts index 8ec0be4e971f..39db327ae60a 100644 --- a/packages/angular_devkit/build_angular/src/utils/action-executor.ts +++ b/packages/angular_devkit/build_angular/src/utils/action-executor.ts @@ -7,9 +7,9 @@ */ import Piscina from 'piscina'; +import { InlineOptions } from './bundle-inline-options'; import { maxWorkers } from './environment-options'; import { I18nOptions } from './i18n-options'; -import { InlineOptions } from './process-bundle'; const workerFile = require.resolve('./process-bundle'); diff --git a/packages/angular_devkit/build_angular/src/utils/process-bundle-bootstrap.js b/packages/angular_devkit/build_angular/src/utils/bundle-inline-options.ts similarity index 52% rename from packages/angular_devkit/build_angular/src/utils/process-bundle-bootstrap.js rename to packages/angular_devkit/build_angular/src/utils/bundle-inline-options.ts index 7ff6bb28fcdc..16977f2bf08e 100644 --- a/packages/angular_devkit/build_angular/src/utils/process-bundle-bootstrap.js +++ b/packages/angular_devkit/build_angular/src/utils/bundle-inline-options.ts @@ -6,5 +6,11 @@ * found in the LICENSE file at https://angular.io/license */ -require('../../../../../lib/bootstrap-local'); -module.exports = require('./process-bundle.ts'); +export interface InlineOptions { + filename: string; + code: string; + map?: string; + outputPath: string; + missingTranslation?: 'warning' | 'error' | 'ignore'; + setLocale?: boolean; +} diff --git a/packages/angular_devkit/build_angular/src/utils/i18n-inlining.ts b/packages/angular_devkit/build_angular/src/utils/i18n-inlining.ts index 4c32203e67f3..2ca51efb8031 100644 --- a/packages/angular_devkit/build_angular/src/utils/i18n-inlining.ts +++ b/packages/angular_devkit/build_angular/src/utils/i18n-inlining.ts @@ -11,10 +11,10 @@ import { EmittedFiles } from '@angular-devkit/build-webpack'; import * as fs from 'fs'; import * as path from 'path'; import { BundleActionExecutor } from './action-executor'; +import { InlineOptions } from './bundle-inline-options'; import { copyAssets } from './copy-assets'; import { assertIsError } from './error'; import { I18nOptions } from './i18n-options'; -import { InlineOptions } from './process-bundle'; import { Spinner } from './spinner'; function emittedFilesToInlineOptions( diff --git a/packages/angular_devkit/build_angular/src/utils/process-bundle.ts b/packages/angular_devkit/build_angular/src/utils/process-bundle.ts index 90beec2d0b07..e492e04e1bbd 100644 --- a/packages/angular_devkit/build_angular/src/utils/process-bundle.ts +++ b/packages/angular_devkit/build_angular/src/utils/process-bundle.ts @@ -20,6 +20,7 @@ import templateBuilder from '@babel/template'; import * as fs from 'fs/promises'; import * as path from 'path'; import { workerData } from 'worker_threads'; +import { InlineOptions } from './bundle-inline-options'; import { allowMinify, shouldBeautify } from './environment-options'; import { assertIsError } from './error'; import { I18nOptions } from './i18n-options'; @@ -65,7 +66,7 @@ async function loadLocalizeTools(): Promise { return loadEsmModule('@angular/localize/tools'); } -export async function createI18nPlugins( +async function createI18nPlugins( locale: string, translation: unknown | undefined, missingTranslation: 'error' | 'warning' | 'ignore', @@ -101,15 +102,6 @@ export async function createI18nPlugins( return { diagnostics, plugins }; } -export interface InlineOptions { - filename: string; - code: string; - map?: string; - outputPath: string; - missingTranslation?: 'warning' | 'error' | 'ignore'; - setLocale?: boolean; -} - interface LocalizePosition { start: number; end: number;