Open NWYLZW opened 1 year ago
me too v3.2.1
project path uri:
d:/...../project-name/...........
vite.config.ts:
{
envDir,
base: "/project-name",
plugins: [
...,
createHtmlPlugin({
pages: [
{
entry: 'src/main.ts',
filename: 'index.html',
template: 'index.html',
injectOptions: {
data: {
title: "..."
}
}
}
]
})
],
}
error
ERROR [vite:build-html] ejs:8 23:12:13
6| <link rel="icon" type="image/svg+xml" href="/logo.png" />
7| <meta name="viewport" content="width=device-width, initial-scale=1.0" />
>> 8| <title><%- title %></title>
9| <style>
10| :root {
11| --app-context-color: #67bc66;
title is not defined
v3.0.6 is ok!
RT
HTML path include vite config base which will unable find target HTML page, because
path.realative
will compute errorhttps://github.com/vbenjs/vite-plugin-html/blob/841d4ef04c3cf5ff0d4339350ae336aa83aa70ed/packages/core/src/htmlPlugin.ts#L102