Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(examples): transpile Angular es5 bundle to SystemJS #2562

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/angular/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ babel(
"--no-babelrc",
"--source-maps",
"--presets=@babel/preset-env",
"--plugins=@babel/plugin-transform-modules-systemjs",
"--out-dir",
"$(@D)",
],
Expand Down
4 changes: 2 additions & 2 deletions examples/angular/src/example/index.prod.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<!-- TODO: figure out how diff. loading interacts with
https://www.npmjs.com/package/rollup-plugin-bundle-html -->
<script type="module" src="/bundle-es2015.min/index.js"></script>
<script nomodule="" src="/bundle-es5.min/index.js"></script>
<script type="module" src="/bundle-es2015.min/index.js?v=TIMESTAMP-VARIABLE"></script>
<script nomodule="">System.import('/bundle-es5.min/index.js?v=TIMESTAMP-VARIABLE')</script>
</body>
</html>
7 changes: 6 additions & 1 deletion examples/angular/src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down