umi4 在index.html中添加脚本和样式

在.umirc.ts中增加配置

import { defineConfig } from "umi";
import HtmlWebpackPlugin from 'html-webpack-plugin';

export default defineConfig({
  
  styles: [
    { content: `#root{height:100%}` },
    { content: `html{height:100%}` },
    { content: `body{height:100%}` },
  ],
  headScripts: [
    {
      content: `function plusReady() {}`, type: 'text/javascript'
    },

  ],
  
});

 

posted @ 2024-09-26 14:04  liuyong111  阅读(354)  评论(0)    收藏  举报