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

不依赖 resourceQuery 生成 module id 导致代码 hot-loader 出现问题 #2037

Open
xiaoshuangLi opened this issue Apr 14, 2023 · 0 comments

Comments

@xiaoshuangLi
Copy link

Version

15.10.0

Reproduction link

Steps to reproduce

What is expected?

生成 shortFilePath 时,添加 resourceQuery 生成的依赖
image

What is actually happening?

image

Issue Description

我们的开发场景时,基于 yaml 生成文档,尽管 yaml 只是一个数据结构,但是我们用的有点奇葩:

./api.yaml ==> 生成的文档,包含组件示例,api 介绍
./api.yaml?yaml-doc=api ==> 只生成 api 介绍

由于 vue-loader 在 15.10.0 之后将 resourceQuery 不再用于生成 module id,所以两个地址生成的 module id 是一样的。导致 hot-loader 运行时,基于 module id ./api.yaml?yaml-doc=api 的结果会覆盖 ./api.yaml 的结果(毕竟 module id 一样)。所以最终 ./api.yaml 使用的组件被替换成了 ./api.yaml?yaml-doc=api 的组件,导致页面出现问题。

下面是图片示例

正确的结果
image

错误的结果
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant