Skip to content

Commit 5325702

Browse files
Renamed folder
1 parent b514c5a commit 5325702

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export function viteHtmlParams(params: Record<string, string>) {
2+
return {
3+
name: "vite-html-params",
4+
enforce: "post",
5+
6+
transformIndexHtml(html: string): string {
7+
for (const [key, value] of Object.entries(params)) {
8+
const pattern = `__${key}__`;
9+
if (!html.includes(pattern)) {
10+
throw new Error(`Expected index.html to contain pattern ${pattern}`);
11+
}
12+
html = html.replaceAll(pattern, value);
13+
}
14+
return html;
15+
},
16+
};
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
2+
3+
export const vitePreactAlias = {
4+
"react-dom/test-utils": "preact/test-utils",
5+
"react-dom": "preact/compat",
6+
"react/jsx-runtime": "preact/jsx-runtime",
7+
react: "preact/compat",
8+
};

packages/common/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export * from "./build/viteHtmlParamsPlugin";
2-
export * from "./build/vitePreactAlias";
1+
export * from "./buildUtil/viteHtmlParamsPlugin";
2+
export * from "./buildUtil/vitePreactAlias";
33
export * from "./constants";
44
export * from "./cursorlessCommandIds";
55
export * from "./cursorlessSideBarIds";

0 commit comments

Comments
 (0)