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 option for persisting assets #11

Merged
merged 3 commits into from Nov 29, 2020
Merged

Add option for persisting assets #11

merged 3 commits into from Nov 29, 2020

Conversation

daun
Copy link
Member

@daun daun commented Jul 29, 2020

Fixes #9 by adding an option to keep certain tags instead of removing them when they're missing from the new page.

Useful for third-party libraries like Google Maps that add custom style tags on load but can't be run again.

new SwupHeadPlugin({ persistAssets: true })

This will use the default selector of link[rel=stylesheet], script[src], style to determine whether to keep a tag even if it wasn't found in the new page's html.

Copy link
Member

@gmrchk gmrchk left a comment

Choose a reason for hiding this comment

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

Brilliant! 👏

@gmrchk gmrchk merged commit c1f2942 into swup:master Nov 29, 2020
@gmrchk
Copy link
Member

gmrchk commented Nov 29, 2020

Published in v1.1.0. Added to docs and changelog.

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.

Make removal of tags optional
2 participants