MapoMagpie / eh-view-enhance

Manga Viewer + Downloader, Focus on experience and low load on the site. Support: e-hentai.org | exhentai.org | pixiv.net | 18comic.vip | nhentai.net | hitomi.la | rule34.xxx | danbooru.donmai.us | gelbooru.com | twitter.com
MIT License
264 stars 8 forks source link

关于 npm run build 的问题 #25

Closed kakuri2020 closed 8 months ago

kakuri2020 commented 8 months ago

我使用 npm install && npm run dev 之后,安装的 server:xxx 脚本是可以使用的

但是用 npm run build 生成的 dist 打包脚本,和你master上的目前有很大的差异(主要在一些以来顺序上),并且有一些错误没办法加载

eh-view-enhance.user.zip

我想问一下你的build环境是什么: 以下是我的: node -v v18.17.1

npm -v 10.2.5

其余就是按照 package.json 里安装的。。。不知道为什么打包的文件差异这么大,甚至出现错误

MapoMagpie commented 8 months ago

node v21.2.0 npm 10.2.3 你打包的我试了下,出现的错误和我 npm run dev 重新热部署时的错误一样,不知道哪里的问题。 你可以试试切换到最新的node再打包试试。

MapoMagpie commented 8 months ago

我用node v18.x试了,打包后的文件没问题。我的系统是linux。

kakuri2020 commented 8 months ago

windows平台下的node最多只有 v20.4.0, 我切换过去还是不行

我去linux试了一下,发现同样的操作,结果就和你master上的一样了

可能是windows下的什么神秘问题 😄

kakuri2020 commented 8 months ago

我试了一下,可能是vite 或者node 或者别的什么在处理module 循环依赖的时候,两个平台下的表现不一样导致的

左边是linux 右边是 windows,在windows下一旦出现循环引用,就会有 xx$1 这样的变量出现。。导致代码出问题。

image

image

image

image

MapoMagpie commented 8 months ago

还有这种事,真是涨见识了。我看看啥时候把循环依赖的问题处理了。