vbenjs / vite-plugin-html

A vite plugin for processing html. It is developed based on lodash template
MIT License
601 stars 96 forks source link

在 monorepo 中,如果 template/index.html 位于其他包中,build 会报错 #159

Open baijunjie opened 3 months ago

baijunjie commented 3 months ago

directory

packages/common/template/index.html
packages/project/vue.config.js

vue.config.js plugin config

createHtmlPlugin({
  minify: false,
  entry: path.resolve(__dirname, 'src/main.js'),
  filename: 'index.html',
  template: path.resolve(__dirname, '../common/template/index.html'),
}),

build error

[vite:build-html] The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "../common/template/index.html".

version vite: 5.3.4 vite-plugin-html: 3.2.2