@300codes/design-system 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -146,14 +146,14 @@ By default icons are loaded from `/icons/{name}.svg`. If your icons live elsewhe
|
|
|
146
146
|
|
|
147
147
|
### SSR — server-side base directory
|
|
148
148
|
|
|
149
|
-
During SSR, `BaseIcon` reads SVG files directly from the filesystem. It looks in `public/` in dev and `
|
|
149
|
+
During SSR, `BaseIcon` reads SVG files directly from the filesystem. It looks in `public/` in dev and `client/` in production builds (Astro default). If your framework uses a different output directory, set `DS_PUBLIC_PATH`:
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
152
|
# Nuxt (files end up in .output/public/)
|
|
153
153
|
DS_PUBLIC_PATH=.output/public nuxt build
|
|
154
154
|
|
|
155
|
-
# Astro (default —
|
|
156
|
-
# DS_PUBLIC_PATH=
|
|
155
|
+
# Astro (default — client/ is already the built-in default, no override needed)
|
|
156
|
+
# DS_PUBLIC_PATH=client
|
|
157
157
|
|
|
158
158
|
# Custom deployment
|
|
159
159
|
DS_PUBLIC_PATH=dist/static astro build
|
package/package.json
CHANGED
|
@@ -33,8 +33,8 @@ const isServer = typeof window === 'undefined';
|
|
|
33
33
|
const notFound =
|
|
34
34
|
'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256"><path d="M48,48V208H80a8,8,0,0,1,0,16H40a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8H80a8,8,0,0,1,0,16ZM216,32H176a8,8,0,0,0,0,16h32V208H176a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Z"></path></svg>';
|
|
35
35
|
|
|
36
|
-
// DS_PUBLIC_PATH overrides the server-side base directory (e.g.
|
|
37
|
-
const serverBase = import.meta.env.PROD ? (import.meta.env.DS_PUBLIC_PATH || '
|
|
36
|
+
// DS_PUBLIC_PATH overrides the server-side base directory (e.g. client for Astro, .output/public for Nuxt).
|
|
37
|
+
const serverBase = import.meta.env.PROD ? (import.meta.env.DS_PUBLIC_PATH || 'client') : 'public';
|
|
38
38
|
|
|
39
39
|
async function getSvgContent(name: string): Promise<string> {
|
|
40
40
|
const warnNotFound = () =>
|