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

Compatibility with the static build #26

Merged
merged 6 commits into from
Feb 17, 2022

Conversation

matthewp
Copy link
Contributor

Now that Vite has been upgraded in Astro, you can use it in astro-icon to gain support for the static build.

I believe this is equivalent to what was happening before and it's working in the www/ app!

Note that this would be a breaking change since it requires Astro 0.23, so you might want to do a prerelease (up to you of course).

@vercel
Copy link

vercel bot commented Feb 11, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

api-astroicon – ./packages/service

🔍 Inspect: https://vercel.com/nmoo/api-astroicon/BMnqcqEP8Dij7iA2YsAY4YojaQfD
✅ Preview: https://api-astroicon-git-fork-matthewp-static-build-compat-nmoo.vercel.app

astroicon – ./packages/www/

🔍 Inspect: https://vercel.com/nmoo/astroicon/8AiBt2tr8BXk97Ex6fu4eWBeNzPb
✅ Preview: https://astroicon-git-fork-matthewp-static-build-compat-nmoo.vercel.app

@matthewp
Copy link
Contributor Author

Unrelated to this change, but in 0.23 you get the Unescaped HTML content found inside expression! warning. I would fix here but I'm unsure the correct way as its used like this:

<svg {...props} astro-icon={name}>{title ? (<title>{title}</title>) : ''}{innerHTML}</svg>

@matthewp
Copy link
Contributor Author

Actually I think I got that.

@@ -25,4 +25,4 @@ ${e}`)
}
---

<svg {...props} astro-icon={name}>{title ? (<title>{title}</title>) : ''}{innerHTML}</svg>
<svg {...props} astro-icon={name}>{title ? (<title>{title}</title>) : ''}<Fragment set:html={innerHTML}/></svg>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is the correct way to do this. Let me know if not.

Copy link
Owner

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Amazing, thank you! 🎉

@matthewp
Copy link
Contributor Author

matthewp commented Feb 17, 2022

Oh, smoke test isn't passing. Possible Vite related :/ I can take a look.

@matthewp
Copy link
Contributor Author

I think this is related to Vite auto-externally dependencies, testing...

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.

2 participants