Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译产出 vite 与 webpack 不一致 #281

Open
MBearo opened this issue Mar 15, 2022 · 2 comments
Open

编译产出 vite 与 webpack 不一致 #281

MBearo opened this issue Mar 15, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@MBearo
Copy link
Contributor

MBearo commented Mar 15, 2022

reskript v5.1.0

// reskript.config.ts
build: {
            appTitle: 'Vercel',
            publicPath: '/vercel/assets/',
        },

编译后的 index.html 中

  • webpack 的资源路径是 /vercel/assets/xxxxx
  • vite 的资源路径是 /vercel/assets/assets/xxxx

翻了下代码,vite 的资源路径是配置里的 base + build.assetsDir,build.assetsDir 默认是 assets,配置中的路径只覆盖了base导致

@otakustay otakustay added the bug Something isn't working label Mar 15, 2022
@otakustay
Copy link
Member

这个问题在当前确实不好处理,事实上只拿到一个publicPath是无法知道哪部分是assets,哪部分是base的,只能猜(比如把最后一级目录去掉是base),但这也不靠谱……

真要解决这个问题,得把publicPath配置的类型改掉,这会是个breaking,我再考虑下怎么办

@Yayoiqz
Copy link

Yayoiqz commented Oct 8, 2022

assetsDir做成可配置的更好?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants