dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
4.11k stars 108 forks source link

[BUG]: basePath is not working except default value #698

Open PerfectPan opened 1 month ago

PerfectPan commented 1 month ago

Reproduce Repo: https://github.com/PerfectPan/waku-issue-698

Setting basePath manualy in waku.config.ts will cause error except /.

/** @type {import('waku/config').Config} */
export default {
  basePath: '/test/'
};

build mode: load js and css file error(pnpm build && pnpm start) CleanShot 2024-05-05 at 14 01 46@2x

dev mode: unknown error(pnpm dev) CleanShot 2024-05-05 at 13 57 04@2x

Some previous reserach can be seen in https://github.com/dai-shi/waku/pull/697#issuecomment-2094563046

Would like to solve it later and also welcome other one to work on this.

dai-shi commented 1 month ago

Thanks for opening an issue. Let's fix it step by step:

  1. SSG
  2. build
  3. dev

By SSG, I mean to build static files and serve from a different folder:

pnpm builld
mkdir ssg
cp -r dist/public ssg/test
npx serve -s ssg