File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
tests/legacy-cli/e2e/tests/i18n Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,16 @@ export async function execute(
156
156
throw new Error ( 'The builder requires a target.' ) ;
157
157
}
158
158
159
+ try {
160
+ require . resolve ( '@angular/localize' ) ;
161
+ } catch {
162
+ return {
163
+ success : false ,
164
+ error : `i18n extraction requires the '@angular/localize' package.` ,
165
+ outputPath : outFile ,
166
+ } ;
167
+ }
168
+
159
169
const metadata = await context . getProjectMetadata ( context . target ) ;
160
170
const i18n = createI18nOptions ( metadata ) ;
161
171
@@ -230,16 +240,6 @@ export async function execute(
230
240
} ,
231
241
) ;
232
242
233
- try {
234
- require . resolve ( '@angular/localize' ) ;
235
- } catch {
236
- return {
237
- success : false ,
238
- error : `Ivy extraction requires the '@angular/localize' package.` ,
239
- outputPath : outFile ,
240
- } ;
241
- }
242
-
243
243
// All the localize usages are setup to first try the ESM entry point then fallback to the deep imports.
244
244
// This provides interim compatibility while the framework is transitioned to bundled ESM packages.
245
245
const localizeToolsModule = await loadEsmModule < typeof import ( '@angular/localize/tools' ) > (
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default async function () {
14
14
15
15
// Should fail if `@angular/localize` is missing
16
16
const { message : message1 } = await expectToFail ( ( ) => ng ( 'extract-i18n' ) ) ;
17
- if ( ! message1 . includes ( `Ivy extraction requires the '@angular/localize' package.` ) ) {
17
+ if ( ! message1 . includes ( `i18n extraction requires the '@angular/localize' package.` ) ) {
18
18
throw new Error ( 'Expected localize package error message when missing' ) ;
19
19
}
20
20
You can’t perform that action at this time.
0 commit comments