Skip to content

Commit 35622de

Browse files
committed
add a new option to set appType to custom
1 parent 049f4c2 commit 35622de

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/html/VirtualHtmlPlugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ export const VirtualHtmlPlugin = (
1313
return {
1414
name: "vite-plugin-virtual-html",
1515
async config(config: UserConfig, { command }: ConfigEnv) {
16-
config.appType = "custom";
1716
_config = config;
1817
if (command === "serve") {
18+
if (_htmlOptions.useCustom) {
19+
config.appType = "custom";
20+
}
1921
_instance = new Serve(_htmlOptions);
2022
} else if (command === "build") {
2123
_instance = new Build(_htmlOptions);

src/html/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ export type HtmlPluginOptions = {
6666
* key: html name, can be *
6767
*/
6868
injectCode?: Record<string, InjectCode>
69-
69+
/**
70+
* is set appType to custom?
71+
*/
72+
useCustom?: boolean
7073
}
7174

7275
/**

0 commit comments

Comments
 (0)