Skip to content

Commit f758dba

Browse files
committed
whattheduck: Fix medal images not bundled in the right path
1 parent 2ba7df7 commit f758dba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/whattheduck/vite.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path';
55
import AutoImport from 'unplugin-auto-import/vite';
66
import { IonicResolver } from 'unplugin-vue-components/resolvers';
77
import Components from 'unplugin-vue-components/vite';
8-
import { defineConfig } from 'vite';
8+
import { defineConfig, normalizePath } from 'vite';
99
import { viteStaticCopy } from 'vite-plugin-static-copy';
1010

1111
import getViteAliases from '../../vite-aliases';
@@ -70,8 +70,11 @@ export default defineConfig({
7070
viteStaticCopy({
7171
targets: [
7272
{
73-
src: '../web/public/images/medals/*.png',
73+
src: normalizePath(path.resolve(__dirname, '../web/public/images/medals/*.png')),
7474
dest: 'images/medals',
75+
// Matched paths are ../web/public/images/medals/<file>.png → destDir becomes
76+
// images/medals/web/public/images/medals; go up 4 segments to land in images/medals/.
77+
rename: (name, ext) => `../../../../${name}.${ext}`,
7578
},
7679
],
7780
}),

0 commit comments

Comments
 (0)