先看打包效果
 
 1、安装vite-plugin-html
 2、配置多个入口
 
 每个入口都要有模板(index.html、App.vue、main.js复制一份,根据实际需求调整三个文件)
 3、配置vite.config.js
 
 4、代码片段
import { createHtmlPlugin } from 'vite-plugin-html'
const htmlParams = {
  minify: true,
  pages: [
    {
      filename: 'index', // filename 默认是template文件名,就是beijing.html
      entry: '/src/main.js',
      template: 'index.html'
    },
    {
      filename: 'form',
      entry: '/src/views/resourceManage/fieldFormManage/main.js',
      template: 'form.html'
    }
  ]
}
 createHtmlPlugin(htmlParams)
  build: {
    rollupOptions: {
      output: {
        assetFileNames: 'assets/[name]-[hash].[ext]', // 静态资源
        chunkFileNames: 'js/[name]-[hash].js', // 代码分割中产生的 chunk
        entryFileNames: 'js/[name]-[hash].js', // 指定 chunks 的入口文件
        compact: true
      }
    }
  }
(完)











![[每周一更]-(第112期):WDL(Workflow Description Language)说明及使用示例](https://i-blog.csdnimg.cn/direct/c0694275ec5a47b5a80c4420fff839c9.jpeg#pic_center)






