antony / sveltekit-adapter-browser-extension

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

Static assets are copied into root folder #2

Open andreasmcdermott opened 2 years ago

andreasmcdermott commented 2 years ago

I have a Svelte project that looks like this:

- src
  - lib
  - routes
  - app.html
  - ...
- static
  - icon.png
  - logo.png 
  - ...

When building, the adapter puts images in static directly into build instead of build/static which is what I'd expect. Currently I modified the adapter like so to work around it:

// Before:
utils.copy_static_files(assets);

// After:
utils.copy_static_files(`${assets}/static`);
antony commented 2 years ago

@andreasmcdermott that's right - it acts much more like a regular adapter in this respect - so that files appear at the root / of your site, the static prefix is dropped.

I don't see why this has to be a constraint though, so maybe it can change.