-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
H5端访问不到分包的static文件 #4997
Labels
uni 工程问题
uni 工程安装
Comments
暂时没有复现,你可以说的详细一点吗,比如具体是哪个页面访问分包图片之类的 |
@GRCmade |
经测试,从 [vite]: Rollup failed to resolve import "/packages/pkg-a/static/image.png" from "***/uni-preset-vue-vite-ts/src/packages/pkg-a/index.vue".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external` |
@GRCmade 直接使用
<template>
<image :src="props.src"></image>
</template>
<script setup lang="ts">
const props = defineProps<{
src: string;
}>()
</script>
<template>
<view class="content">
<!-- 无法正常显示 -->
<app-image src="@/packages/pkg-a/static/image.png"></app-image>
<!-- 可以正常显示 -->
<image src="@/packages/pkg-a/static/image.png"></image>
</view>
</template>
<script setup lang="ts">
import AppImage from "@/components/AppImage.vue";
</script> |
@GRCmade 你好,请问有解决方案吗?🤔 |
@Otto-J 能看看这个问题吗? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
微信小程序端dev和build模式都可以正常访问到,但是H5端dev模式下找不到文件,build会报错
版本信息
The text was updated successfully, but these errors were encountered: