Skip to content

Commit b454563

Browse files
huseeiinbirkskyum
andauthored
feat: add option to change public directory (#1921)
Co-authored-by: Birk Skyum <74932975+birkskyum@users.noreply.github.com>
1 parent eafd915 commit b454563

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.changeset/soft-beans-take.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/start": minor
3+
---
4+
5+
adds the option to change the public directory to something other than the default "public"

packages/start/config/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type ViteCustomizableConfig = CustomizableConfig & {
1414
};
1515

1616
type SolidStartInlineConfig = {
17+
publicDir?: string;
1718
ssr?: boolean;
1819
solid?: Options;
1920
extensions?: string[];

packages/start/config/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export function defineConfig(baseConfig = {}) {
7171
let { vite = {}, ...start } = baseConfig;
7272
const extensions = [...DEFAULT_EXTENSIONS, ...(start.extensions || [])];
7373
start = defu(start, {
74+
publicDir: "./public",
7475
appRoot: "./src",
7576
routeDir: "./routes",
7677
ssr: true,
@@ -110,7 +111,7 @@ export function defineConfig(baseConfig = {}) {
110111
name: "public",
111112
type: "static",
112113
base: "/",
113-
dir: "./public"
114+
dir: start.publicDir
114115
},
115116
{
116117
name: "ssr",

0 commit comments

Comments
 (0)