소스 검색

打包路径错误修复

gr 5 달 전
부모
커밋
06c6d1a887
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/components/UeVideo.vue
  2. 1 1
      vite.config.js

+ 1 - 1
src/components/UeVideo.vue

@@ -132,7 +132,7 @@ function handleLogin(e) {
 
 onMounted(() => {
   const script = document.createElement('script');
-  script.src = '/src/utils/peer-stream.js'; // 自定义元素文件的路径
+  script.src = new URL(`/src/utils/peer-stream.js`, import.meta.url).href // 自定义元素文件的路径
   script.async = true;
   script.onload = () => {
     console.log('PeerStream custom element script loaded');

+ 1 - 1
vite.config.js

@@ -39,5 +39,5 @@ export default defineConfig({
       ]
     }
   },
-  publicPath: './'
+  base: '/low_altitude/',
 })