# uniapp-base-config-debug **Repository Path**: wtto00/uniapp-base-config-debug ## Basic Information - **Project Name**: uniapp-base-config-debug - **Description**: vite+vue3+cli打包到H5,配置publicPath为cdn地址无效; 配置vite.config.js中的base为http://www.test-cdn.com/h5/后,我再进首页,会自动重定向到http://localhost:3000http://www.test-cdn.com/h5/,这样的地址形式,导致打不开页面 - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-08-18 - **Last Updated**: 2022-08-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 配置 publicPath 为 cdn 地址无效 [uniapp 问答论坛帖子](https://ask.dcloud.net.cn/question/151509?notification_id-1128246__rf-false__item_id-209444) ### 复现步骤 ```bash # 1. 拉取复现代码 git clone git@gitee.com:wtto00/uniapp-base-config-debug.git # 2. 进入项目目录 cd uniapp-base-config-debug # 3. 安装依赖 pnpm i # 4. 打包 pnpm build:h5 ``` **本地启动 node 服务器,用做 cdn 服务器** ```bash cd dist/build/h5/ pnpx http-server -p 5050 --cors . ``` 启动完成后,就可以配置 cdn 前缀为 `http://localhost:5050/` **重开一个终端,启动一个 node 服务器访问项目** ```bash cd dist/build/h5/ pnpx http-server . ``` 启动完成后,就可以访问`http://localhost:8080/`,查看问题