ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.28k stars 8.14k forks source link

🐛 [BUG] #10621

Closed webguicai closed 1 year ago

webguicai commented 1 year ago

🐛 bug 描述

config.ts文件配置 publicPath: process.env.NODE_ENV === 'production' ? './' : '/',打包后不生效,会报Not allowed to load local resource: file:///C:/user/login

📷 复现步骤 | Recurrence steps

config.ts增加publicPath: process.env.NODE_ENV === 'production' ? './' : '/',

🏞 期望结果 | Expected results

打包后打开index.html不会报错,可以显示页面

💻 复现代码 | Recurrence code

// https://umijs.org/config/ import { defineConfig } from '@umijs/max'; import { join } from 'path'; import defaultSettings from './defaultSettings'; import proxy from './proxy'; import routes from './routes';

const { REACT_APP_ENV = 'dev' } = process.env; export default defineConfig({ /**

© 版本信息

Ant Design Pro 版本: 6.0.0 umi 版本: 4.x 浏览器环境: Chrome 开发环境: node 16.19.0

🚑 其他信息

github-actions[bot] commented 1 year ago

当前 Issue 未检测到标题,请规范填写,谢谢!

The title of the current issue is not detected, please fill in according to the specifications, thank you!