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-ts模板打包subpackage后静态资源路径错误 #96

Open
llllllllllx opened this issue Apr 16, 2024 · 0 comments
Open

vite-ts模板打包subpackage后静态资源路径错误 #96

llllllllllx opened this issue Apr 16, 2024 · 0 comments

Comments

@llllllllllx
Copy link

llllllllllx commented Apr 16, 2024

image
静态资源使用相对路径,但使用npm run build:mp-weixin -- --subpackage=sub1打包后图片资源路径就变成了绝对路径。

在更改vite.config.ts中的base改成'./'后依然打包成了绝对路径
image

使用alias引用图片,也依然打包成绝对路径

package.json相关环境如下

"dependencies": {
    "@dcloudio/uni-app": "3.0.0-4000820240401001",
    "@dcloudio/uni-app-plus": "3.0.0-4000820240401001",
    "@dcloudio/uni-components": "3.0.0-4000820240401001",
    "@dcloudio/uni-h5": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-alipay": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-baidu": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-jd": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-kuaishou": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-lark": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-qq": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-toutiao": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-weixin": "3.0.0-4000820240401001",
    "@dcloudio/uni-mp-xhs": "3.0.0-4000820240401001",
    "@dcloudio/uni-quickapp-webview": "3.0.0-4000820240401001",
    "vue": "^3.3.11",
    "vue-i18n": "^9.1.9"
  },
  "devDependencies": {
    "@dcloudio/types": "^3.3.2",
    "@dcloudio/uni-automator": "3.0.0-4000820240401001",
    "@dcloudio/uni-cli-shared": "3.0.0-4000820240401001",
    "@dcloudio/uni-stacktracey": "3.0.0-4000820240401001",
    "@dcloudio/vite-plugin-uni": "3.0.0-4000820240401001",
    "@types/node": "^20.12.7",
    "@vue/runtime-core": "^3.3.11",
    "@vue/tsconfig": "^0.1.3",
    "typescript": "^4.9.4",
    "vite": "4.3.5",
    "vue-tsc": "^1.0.24"
  }
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