-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: introduce clientBundle.includeCustomCollections
option, #34
#223
Conversation
@antfu I'm trying
our ssr: false, // including this because we need exactly the `ssr: false` & `icon.provider: 'server'` combination for our setup
icon: {
provider: 'server',
localApiEndpoint: '/_nuxt_icons',
customCollections: [
{
prefix: 'light',
dir: './assets/icons/light',
},
{
prefix: 'solid',
dir: './assets/icons/solid',
},
{
prefix: 'brands',
dir: './assets/icons/brands',
},
],
// not including this didn't bundle icons into client, and it still triggered requests to `/_nuxt_icons/light.json?icons=…`
// including it, fails the build like mentioned above
clientBundle: {
includeCustomCollections: true,
},
}, |
@zigomir hey, could you help to create a new issue with a minimal reproduction so I can test out? Thanks |
@antfu https://stackblitz.com/edit/github-lhrb3c?file=nuxt.config.ts,app.vue,package.json I'm running: npm run generate && npm run preview (note: for the first time you'll need to press Also, |
@antfu thanks, I see it's been fixed with v1.4.2 and or v1.4.3, but that only works for the default, I added a |
@antfu sorry for spamming, but I've found a workaround that might help you figure out the actual fix much faster than it would take me (btw, See this diff: main...zigomir:icon:local-fs-svg-issue-reproduction (or clone https://github.com/zigomir/icon/tree/local-fs-svg-issue-reproduction). The main thing is: if you set import { defineAppConfig } from '#imports'
export default defineAppConfig({
icon: {
mode: 'svg',
},
}) then no custom collection icon will render unless there's one that uses <Icon
style="display: none;"
name="custom1:nuxt-v3"
size="64"
mode="css"
/> |
@zigomir Please, create a new issue with the information you provided (and you don't need to @ me, I will see it) - this would help us keep track on them easier. We are very unlikely to keep checking comments in a closed/merged pr. |
Introduce
clientBundle.includeCustomCollections
, which defaults to:true
whenprovider
is notserver
- a.k.assr: false
false
otherwiseThis allows custom collections to live with in the client bundle without network request.