Browse Source

fix: 解决 headScripts 链接与 publicPath 不匹配

pull/11289/head
jump-and-jump 2 years ago
committed by wsafight
parent
commit
7f25fe5f7a
  1. 11
      config/config.ts

11
config/config.ts

@ -7,6 +7,13 @@ 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
@ -15,6 +22,8 @@ export default defineConfig({
*/
hash: true,
publicPath: PUBLIC_PATH,
/**
* @name
* @description ie11 使
@ -125,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'],

Loading…
Cancel
Save