Skip to content

Support multiple static asset dirs by allowing string arrays for config.kit.files.assets #5115

@janosh

Description

@janosh

Describe the problem

I'd like to get static assets from multiple locations. In this example the SvelteKit site is inside the site/ directory as part of a bigger project and I'd like to use static assets from assets/ and site/static/.

.
├── assets
│   ├── ...
└── site
    ├── src
    ├── static
    └── ...

Describe the proposed solution

config.kit.files.assets could support arrays:

// svelte.config.jg

export default {
  kit: {
    adapter: adapter(),

    files: {
      assets:[ `../assets`, `./static` ],
    },
  },
}

This currently raises

config.kit.files.assets should be a string, if specified

Alternatives considered

Create an alias of assets/ in site/static/. It works but feels hacky.

Importance

nice to have

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions