michmich112 / sveltekit-adapter-chrome-extension

Sveltekit adapter for making chrome extensions
MIT License
108 stars 17 forks source link

Unable to find the app.html in the build dir #27

Closed ziedHamdi closed 1 year ago

ziedHamdi commented 1 year ago

Hi,

I'm a react developer seduced by the svelte syntax, so I thought I'd write my next chrome extension with it.

My build directory is missing the html file: image

I started a new project in a few steps: npm init svelte@latest image

pnpm i -D sveltekit-adapter-chrome-extension changed the svelte.config.js and added a manifest.json to the static dir pnpm run build

image

Did I miss something in the process? I can't find the html file

Here's my project structure: image

wallw-teal commented 1 year ago

I think you may have missed this note in the readme:

🚧 If you are using SvelteKit v1.0.0+, make sure to set your prerender=true for every page reference by your extension so SvelteKit generates the HTML files.

So add a src/routes/+layout.js file which looks like this:

export const prerender = true;

You can see the Svelte Kit docs for that option here and they also have a note about using it with Static Site Generation here.

ziedHamdi commented 1 year ago

Great!

Thank you, that worked.