antony / sveltekit-adapter-browser-extension

Build browser extensions with Svelte (early prototype)
160 stars 19 forks source link

Fallback config? #4

Open andreasmcdermott opened 2 years ago

andreasmcdermott commented 2 years ago

I tried to use the fallback property in the same way I used it for a SPA I built in SvelteKit. I have a app.html file that was used as fallback. When I pass that to this adapter, it outputs a app.html into the build folder, but this adapter is hard coded to look for index.html here:

const indexPage = join(assets, 'index.html')
const index = readFileSync(indexPage)

Is that a bug, or how would the fallback be used?

antony commented 2 years ago

Hi - I'd not thought about it. Perhaps you fancy making a PR to provide some sort of behaviour for this?

andreasmcdermott commented 2 years ago

It is a bit unclear to me what fallback should be doing? I believe in a normal SvelteKit app, it is used for creating a SPA, but it seems like this enforces SPA behavior regardless. So maybe the property isn't needed?

Note: The reason I had/have fallback is because I was migrating from a SPA to an extension, not because I need it etc