Skip to content

Commit

Permalink
Merge branch 'master' into feat/enable-mako
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Oct 9, 2024
2 parents 4228e80 + e48e314 commit c8220a0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ import routes from './routes';

const { REACT_APP_ENV = 'dev' } = process.env;

/**
* @name 使用公共路径
* @description 部署时的路径,如果部署在非根目录下,需要配置这个变量
* @doc https://umijs.org/docs/api/config#publicpath
*/
const PUBLIC_PATH: string = '/';

export default defineConfig({
/**
* @name 开启 hash 模式
* @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。
* @doc https://umijs.org/docs/api/config#hash
*/
hash: true,

publicPath: PUBLIC_PATH,

/**
* @name 兼容性设置
* @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖
Expand Down Expand Up @@ -124,7 +134,7 @@ export default defineConfig({
*/
headScripts: [
// 解决首次加载时白屏的问题
{ src: '/scripts/loading.js', async: true },
{ src: join(PUBLIC_PATH, 'scripts/loading.js'), async: true },
],
//================ pro 插件配置 =================
presets: ['umi-presets-pro'],
Expand Down

0 comments on commit c8220a0

Please sign in to comment.