File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
packages/angular_devkit/build_angular/src/dev-server
tests/legacy-cli/e2e/tests/i18n Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,9 @@ async function setupLocalize(
367
367
translationIntegrity : localeDescription && localeDescription . integrity ,
368
368
} ) ,
369
369
plugins,
370
+ parserOpts : {
371
+ plugins : [ 'dynamicImport' ] ,
372
+ } ,
370
373
} ,
371
374
} ,
372
375
] ,
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export const langTranslations = [
57
57
} ,
58
58
] ;
59
59
export const sourceLocale = langTranslations [ 0 ] . lang ;
60
+
60
61
export const externalServer = ( outputPath : string ) => {
61
62
const app = express ( ) ;
62
63
app . use ( express . static ( resolve ( outputPath ) ) ) ;
@@ -87,6 +88,13 @@ export async function setupI18nConfig(useLocalize = true) {
87
88
<p id="plural" i18n>Updated {minutes, plural, =0 {just now} =1 {one minute ago} other {{{minutes}} minutes ago}}</p>
88
89
` ) ;
89
90
91
+ // Add a dynamic import to ensure syntax is supported
92
+ // ng serve support: https://github.com/angular/angular-cli/issues/16248
93
+ await writeFile ( 'src/app/dynamic.ts' , `export const abc = 5;` ) ;
94
+ await appendToFile ( 'src/app/app.component.ts' , `
95
+ (async () => { await import('./dynamic'); })();
96
+ ` ) ;
97
+
90
98
// Add e2e specs for each lang.
91
99
for ( const { lang, translation } of langTranslations ) {
92
100
await writeFile ( `./e2e/src/app.${ lang } .e2e-spec.ts` , `
You can’t perform that action at this time.
0 commit comments