diff --git a/examples/angular/src/BUILD.bazel b/examples/angular/src/BUILD.bazel index 3515db5ded..dd7e21a332 100644 --- a/examples/angular/src/BUILD.bazel +++ b/examples/angular/src/BUILD.bazel @@ -155,6 +155,7 @@ babel( "--no-babelrc", "--source-maps", "--presets=@babel/preset-env", + "--plugins=@babel/plugin-transform-modules-systemjs", "--out-dir", "$(@D)", ], diff --git a/examples/angular/src/example/index.prod.html b/examples/angular/src/example/index.prod.html index 42adb68b16..fc985f9dda 100644 --- a/examples/angular/src/example/index.prod.html +++ b/examples/angular/src/example/index.prod.html @@ -26,7 +26,7 @@ - - + + diff --git a/examples/angular/src/prerender.ts b/examples/angular/src/prerender.ts index a613e9c508..eb8bf51056 100644 --- a/examples/angular/src/prerender.ts +++ b/examples/angular/src/prerender.ts @@ -14,7 +14,12 @@ const routes = process.argv.slice(routesFlagIdx + 1, process.argv.length); const outsFlagIdx = process.argv.findIndex(arg => arg === '--outs'); const outs = process.argv.slice(outsFlagIdx + 1, routesFlagIdx); -const document = readFileSync(rootIndexPath, { encoding: 'utf8' }); +const document = readFileSync(rootIndexPath, {encoding: 'utf8'}) + // Replace the timestamp placeholder for cache busting. + // This is done per build and not per request, so the timestamp + // remains the same, until the app (or more precisely the prerender + // target) is rebuilt. + .replace(/TIMESTAMP-VARIABLE/g, `${Date.now()}`); const win: any = domino.createWindow(document); declare const global: any;