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

Add a inline registration strategy #86

Merged
1 commit merged into from
Sep 15, 2017
Merged

Add a inline registration strategy #86

1 commit merged into from
Sep 15, 2017

Conversation

ghost
Copy link

@ghost ghost commented Sep 15, 2017

Closes #67


indexHtml = indexHtml.replace('ESW_INLINE_PLACEHOLDER', swRegistration);

fs.writeFileSync(path.join(this.outputPath, 'index.html'), indexHtml);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will force index.html to be re-rewitten for every rebuild. This breaks things like css hot-reloading (which is a built in feature of ember-cli) because it forces all rebuilds to modify the HTML itself (css hot-reloading requires a CSS file only change after the rebuild).

I'd suggest caching here to avoid writing the file on every rebuild (e.g. if the contents have not changed, don't write to it).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Rob, do you have a handy link demonstrating how to add caching to such a thing?

@ghost ghost merged commit ff7f867 into master Sep 15, 2017
@ghost ghost deleted the inline-registration branch September 15, 2017 18:21
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant