html

    breakchange in v3.1.4
    • 页面生成配置
    • 类型: HtmlType
    export interface HtmlType extends HtmlRspackPluginOptions {
      /**
       * 基于项目的根目录 index.html file path
       * @default src/index.html
       */
      template?: string
      /**
       * 基于项目的根目录 favicon file path
       * @default src/favicon.ico
       */
      favicon?: string
      /**
       * 网站语言
       */
      lang?: string
      /**
       * externals 文件插入到html breakchange in v3.1.4
       */
      tags?: {
        type: "js" | "css";
        src?: string;
        content?: string;
        pos?: "head" | "body";
      }[]
    }
    TIP

    3.1.4及以后的版本,把filestags 统一合并到 tags?: InjectHeadTagsTypeItem[] 中配置

    emp-config.js
    import {defineConfig} from '@empjs/cli'
    export default defineConfig(store => {
      return {
        html: {
          template: 'src/index.html',
        },
      }
    })

    html

    html.files removed in version 3.1.4 and html.tags upgrade in version 3.1.4
    • 页面生成配置
    • 类型: HtmlType
    export interface HtmlType extends HtmlRspackPluginOptions {
      files?: {
        /**
         * 插入 css
         */
        css?: string[]
        /**
         * 插入 js
         */
        js?: string[]
      },
      /**
       * 自定义 头部脚步内容 需要 template 配合 
       */
      tags?: {
        headTags?: any[]
        bodyTags?: any[]
      }
    }