在Vue3项目中,使用import.meta.env.VITE_BASE_PATH(注意环境变量通常是大写的,且Vite默认前缀为VITE_)作为路由的基础路径在开发环境中通常是可行的,但在打包过程中可能会遇到一些问题。以下是对这些问题的详细分析和可能的解决方案: 1. 环境变量在打包时的处理 问题:import.meta.env.VITE_BASE_PATH在Vite的开发服...
VITE_API_BASEPATH=/dev-api # 接口地址 VITE_API_URL=/admin-api 3 changes: 0 additions & 3 deletions 3 .env.prod Original file line numberDiff line numberDiff line change @@ -11,9 +11,6 @@ VITE_UPLOAD_TYPE=server # 上传路径 VITE_UPLOAD_URL='http://localhost:48080/admin-api/inf...
Clear and concise description of the problem Sometimes we might run a built Vite site in a number of different locations. It would be convenient to have vite support for setting the public base path dynamically rather than just at build ...
Sign in Sign up vitejs / vite Public Sponsor Notifications Fork 6.1k Star 67.9k Code Issues 470 Pull requests 171 Discussions Actions Projects 1 Security 6 Insights Publish Any Commit docs: relative base path #2726 Sign in to view logs Summary Jobs build Run details Usage Workflo...
patak-dev synchronize #18355 sapphi-red:docs/relative-base Status Success Total duration 2m 22s Artifacts – ci.yml on: pull_request Get changed files 5s Lint: node-20, ubuntu-latest 2m 13s Matrix: test 1 job completed Show all jobs Build & Test Passed or Skipped 0s Build ...
Next generation frontend tooling. It's fast! Contribute to vitejs/vite development by creating an account on GitHub.
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ Show more deploy The following...
New updates on head repo. vitejs/vite@7db105dshuuji3 added a commit to shuuji3/vite-docs-ja that referenced this issue Oct 16, 2024 docs: relative base path … Verified 6e524d5 shuuji3 mentioned this issue Oct 16, 2024 docs: relative base path #1612 Merged shuuji3 added a ...
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ Show more Deprecation notice: v...
Description Refer to this closed issue: #11142 Now I have a use case need to use relative base path in dev mode. I have a container app A and will load the sub app B with iframe. B is built by vite. In local development, A start in port ...