Skip to content

Commit 72d0ae0

Browse files
committed
fix: public dir path error
1 parent 48ec521 commit 72d0ae0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/node/plugin-island/config.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,11 @@ export function pluginConfig(
118118
configureServer(server) {
119119
return async () => {
120120
// Serve public dir
121-
if (await fs.pathExists(PUBLIC_DIR)) {
122-
server.middlewares.use(sirv(path.join(config.root, PUBLIC_DIR)));
121+
// Cause by the pre-bundle problem, we have to set the island package as the root dir
122+
// So we need to serve the public dir in user's root dir manually
123+
const publicDir = path.join(config.root, PUBLIC_DIR);
124+
if (await fs.pathExists(publicDir)) {
125+
server.middlewares.use(sirv(publicDir));
123126
}
124127
};
125128
}

0 commit comments

Comments
 (0)