Skip to content

Import images #83

Locked Answered by ghost
ghost asked this question in Q&A
Jan 8, 2021 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

I created this variable to exclude some types const MIME_EXCLUDE = ["image", "font"];.

And then added this condition:

if (
      req.url.indexOf("/web_modules/microsite") === -1 &&
      !MIME_EXCLUDE.includes(result.contentType.split("/")[0])
    ) {
   ...
}

and now it loads assets as expected.


Just a side note: I'm building my site, I set out to find any SSG built on top of snowpack that would fit my needs. Found SveletKit and microsite, but they are still young, so I'm building it in another mature framework and copying and pasting in projects with these young frameworks to see what sticks and what doesn't. :)

microsite looks promising, looking forward to it!

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Comment options

You must be logged in to vote
1 reply
@natemoo-re
Comment options

Answer selected by natemoo-re
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant