-
Notifications
You must be signed in to change notification settings - Fork 6.8k
universal: dump out the prerendered file so we can examine it #8483
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
Conversation
@@ -15,7 +15,10 @@ const result = renderModuleFactory(KitchenSinkServerModuleNgFactory, { | |||
}); | |||
|
|||
result | |||
.then(() => log('Prerender done.')) | |||
.then(content => { | |||
writeFileSync(join(__dirname, 'index-prerendered.html'), content, 'utf-8'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we output that file in the dist/
folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, should be under dist/
. I thought I added this when I originally wrote this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially it just printed out the file in the console, but that made it hard to see any exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's too much. We should just write it to dist/index-prerendered.html
and also not under dist/packages/demo-app
since it's actually the universal app.
Idea: If we fully use CircleCI at some point, there is the option to upload the index file as an artifact. Meaning that we can download and inspect the output file easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not under dist/packages/universal-app
? That's actually what I meant to do, just copy/paste-failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that works too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently I can't import {buildConfig} from 'material2-build-tools'
in this file and __dirname
seems to point to the correct directory anyways, since we're running the version of the prerender script from dist/packages/universal-app
, so... just gonna switch this back to how it was originally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.