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(
367367 translationIntegrity : localeDescription && localeDescription . integrity ,
368368 } ) ,
369369 plugins,
370+ parserOpts : {
371+ plugins : [ 'dynamicImport' ] ,
372+ } ,
370373 } ,
371374 } ,
372375 ] ,
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export const langTranslations = [
5757 } ,
5858] ;
5959export const sourceLocale = langTranslations [ 0 ] . lang ;
60+
6061export const externalServer = ( outputPath : string ) => {
6162 const app = express ( ) ;
6263 app . use ( express . static ( resolve ( outputPath ) ) ) ;
@@ -87,6 +88,13 @@ export async function setupI18nConfig(useLocalize = true) {
8788 <p id="plural" i18n>Updated {minutes, plural, =0 {just now} =1 {one minute ago} other {{{minutes}} minutes ago}}</p>
8889 ` ) ;
8990
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+
9098 // Add e2e specs for each lang.
9199 for ( const { lang, translation } of langTranslations ) {
92100 await writeFile ( `./e2e/src/app.${ lang } .e2e-spec.ts` , `
You can’t perform that action at this time.
0 commit comments