Harry-Chen / Learn-Helper

清华大学网络学堂助手
https://chrome.google.com/webstore/detail/learn-helper/mdehapphdlihjjgkhmoiknmnhcjpjall
MIT License
208 stars 37 forks source link

[bug] 无法使用dev模式 #162

Closed AsakuraMizu closed 1 month ago

AsakuraMizu commented 4 months ago
yarn dev
# in another terminal window
yarn serve:chrome

初步判断是 c985819 引起的,在 50e3165 中没有该问题,而在 8e8025a 中则可以复现此问题

AsakuraMizu commented 4 months ago

确认为 Vite 5 引起了此问题;但是实际上如果把生成的 serviceWorker.js 进行一下手动修改

// import "http://localhost:5173/@vite/client";
import "http://localhost:5173/src/background.ts";

似乎也能够正常工作

考虑到 https://github.com/samrum/vite-plugin-web-extension 的维护不是很 active,以往使用中问题也较多,计划切换到更 active 也更完善的 https://github.com/aklinker1/vite-plugin-web-extension/

AsakuraMizu commented 4 months ago

好像不管是换 https://github.com/wxt-dev/wxt 还是 https://github.com/aklinker1/vite-plugin-web-extension 改动都有点大,先把 vite 回退到 v4 了