From 67f5277d8ce584cf18a281eaf61dfd7f8fc558bb Mon Sep 17 00:00:00 2001 From: alexzhang1030 <1642114555@qq.com> Date: Sat, 30 Dec 2023 11:04:31 +0800 Subject: [PATCH 1/2] fix(core): remove public prefix that resolves vite host assets warning --- packages/core/src/vite-rpc/assets.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/vite-rpc/assets.ts b/packages/core/src/vite-rpc/assets.ts index c111e70c..13949b9a 100644 --- a/packages/core/src/vite-rpc/assets.ts +++ b/packages/core/src/vite-rpc/assets.ts @@ -83,6 +83,8 @@ export function setupAssetsRPC(config: SetupAssetsOptions) { cache = await Promise.all(files.map(async (path) => { const filePath = resolve(dir, path) const stat = await fsp.lstat(filePath) + // remove public prefix that resolve vite assets warning + path = path.startsWith('public/') ? path.slice(7) : path return { path, publicPath: join(baseURL, path), From 74233185a5e921599d2a464d8bd361d90789d0b8 Mon Sep 17 00:00:00 2001 From: Arlo Date: Sat, 30 Dec 2023 17:01:31 +0800 Subject: [PATCH 2/2] chore: update --- packages/core/src/vite-rpc/assets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/vite-rpc/assets.ts b/packages/core/src/vite-rpc/assets.ts index 13949b9a..b27171c0 100644 --- a/packages/core/src/vite-rpc/assets.ts +++ b/packages/core/src/vite-rpc/assets.ts @@ -83,7 +83,7 @@ export function setupAssetsRPC(config: SetupAssetsOptions) { cache = await Promise.all(files.map(async (path) => { const filePath = resolve(dir, path) const stat = await fsp.lstat(filePath) - // remove public prefix that resolve vite assets warning + // remove public prefix to resolve vite assets warning path = path.startsWith('public/') ? path.slice(7) : path return { path,