You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我先用git clone后,
(我使用的是pnpm)
直接执行pnpm vite可以运行
执行pnpm run build后 src/core/components/ShaderTest.ts报错
src/core/components/ShaderTest.ts(2,125): error TS2307: Cannot find module "../libs/xviewer" or its corresponding type declarations.
src/core/components/ShaderTest.ts(35,14): error TS2339: Property "viewer" does not exist on type "ShaderTest".
src/core/components/ShaderTest.ts(46,14): error TS2339: Property "viewer" does not exist on type "ShaderTest".
src/core/components/ShaderTest.ts(52,33): error TS2304: Cannot find name "cameraCenter".
src/core/components/ShaderTest.ts(53,34): error TS2304: Cannot find name "cameraCenter".
打包到dist文件夹后,直接pnpm run preview可以正常运行,但是将dist放到自己的服务器下运行时资源路径会出现错误
(一些png, mp3文件路径/Genshin/*被直接定向至域名下的根目录localhost:8080/Genshin/*,而实际路径为localhost:8080/www-genshin/Genshin/*)
我先用
git clone
后,(我使用的是
pnpm
)直接执行
pnpm vite
可以运行执行
pnpm run build
后src/core/components/ShaderTest.ts
报错我的解决:
../libs/xviewer
改为../../libs/xviewer
(路径错误)cameraCenter
未知报错)打包到
dist
文件夹后,直接pnpm run preview
可以正常运行,但是将dist
放到自己的服务器下运行时资源路径会出现错误(一些
png
,mp3
文件路径/Genshin/*
被直接定向至域名下的根目录localhost:8080/Genshin/*
,而实际路径为localhost:8080/www-genshin/Genshin/*
)我的解决:
vite.config.ts
配置文件中修改为相对路径export default defineConfig({ + base: "./", plugins: [react()], })
src/pages/Menu.tsx
中引用的jump.png
文件路径(第45行)src/core/Game.ts
中引用的mp3
文件路径(第191~194行)The text was updated successfully, but these errors were encountered: