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

[Bug Report] vant-cli打包时会把带有.的第三方包误判为相对路径 #13287

Open
wangzhenzhen111 opened this issue Dec 27, 2024 · 0 comments

Comments

@wangzhenzhen111
Copy link

重现链接

https://codesandbox.io/p/devbox/vant-clida-bao-bug-y493jv?file=%2Fsrc%2Fcomponents%2FHelloWorld.vue%3A18%2C9

Vant 版本

4.9.15

描述一下你遇到的问题。

我的组件中引用了pixi.js,使用vant-cli打包后会把pixi.js误判为相对路径,并把pixi.js改写为了pixi.js.mjs
import { Application, Loader, LoaderResource } from 'pixi.js';

重现步骤

function getPathByImport(code: string, filePath: string) {
const relativePath = getImportRelativePath(code);

if (relativePath.includes('.')) {
return fillExt(join(filePath, '..', relativePath));
}

return null;
}

看了下源码这里误判

设备/浏览器

No response

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

No branches or pull requests

1 participant