Skip to content

Commit 640f3f2

Browse files
purgecss
1 parent aecbada commit 640f3f2

7 files changed

Lines changed: 597 additions & 134 deletions

File tree

packages/cheatsheet-local/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
"tslib": "^2.8.1"
3232
},
3333
"devDependencies": {
34-
"@preact/preset-vite": "^2.10.3",
3534
"@types/jest": "^30.0.0",
3635
"@types/node": "^24.12.0",
3736
"jest": "^30.3.0",
3837
"typescript": "^5.9.3",
3938
"vite": "^8.0.0",
39+
"vite-plugin-purgecss": "^0.2.13",
4040
"vite-plugin-singlefile": "^2.3.0"
4141
}
4242
}

packages/cheatsheet-local/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defaultCheatsheetInfo } from "@cursorless/cheatsheet";
22
import { viteHtmlParams } from "@cursorless/common";
3-
import preact from "@preact/preset-vite";
43
import { defineConfig, type UserConfig } from "vite";
4+
import purgeCss from "vite-plugin-purgecss";
55
import { viteSingleFile } from "vite-plugin-singlefile";
66

77
export default defineConfig((): UserConfig => {
@@ -15,7 +15,7 @@ export default defineConfig((): UserConfig => {
1515
},
1616

1717
plugins: [
18-
preact(),
18+
purgeCss({}),
1919
viteSingleFile(),
2020
viteHtmlParams({
2121
FAKE_CHEATSHEET_INFO: JSON.stringify(defaultCheatsheetInfo),

packages/cursorless-org/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
"wouter-preact": "^3.9.0"
3131
},
3232
"devDependencies": {
33-
"@preact/preset-vite": "^2.10.3",
3433
"@types/node": "^24.12.0",
3534
"eslint": "^10.0.3",
3635
"http-server": "^14.1.1",
3736
"typescript": "^5.9.3",
3837
"vite": "^8.0.0",
38+
"vite-plugin-purgecss": "^0.2.13",
3939
"vite-plugin-svgr": "^4.5.0"
4040
}
4141
}

packages/cursorless-org/vite.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CURSORLESS_ORG_URL, viteHtmlParams } from "@cursorless/common";
2-
import preact from "@preact/preset-vite";
32
import type { UserConfig } from "vite";
43
import { defineConfig } from "vite";
4+
import purgeCss from "vite-plugin-purgecss";
55
import svgr from "vite-plugin-svgr";
66
import {
77
DESCRIPTION,
@@ -29,10 +29,17 @@ export default defineConfig((): UserConfig => {
2929

3030
resolve: {
3131
conditions: ["cursorless:bundler"],
32+
33+
alias: {
34+
"react-dom/test-utils": "preact/test-utils",
35+
"react-dom": "preact/compat",
36+
"react/jsx-runtime": "preact/jsx-runtime",
37+
react: "preact/compat",
38+
},
3239
},
3340

3441
plugins: [
35-
preact(),
42+
purgeCss({}),
3643
svgr(),
3744
viteHtmlParams({
3845
CURSORLESS_ORG_URL,

packages/cursorless-vscode-tutorial-webview/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"preact": "^10.29.0"
2020
},
2121
"devDependencies": {
22-
"@preact/preset-vite": "^2.10.3",
2322
"@types/vscode-webview": "^1.57.5",
24-
"vite": "^8.0.0"
23+
"vite": "^8.0.0",
24+
"vite-plugin-purgecss": "^0.2.13"
2525
}
2626
}

packages/cursorless-vscode-tutorial-webview/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import preact from "@preact/preset-vite";
21
import { defineConfig, type UserConfig } from "vite";
2+
import purgeCss from "vite-plugin-purgecss";
33

44
export default defineConfig((): UserConfig => {
55
return {
@@ -24,6 +24,6 @@ export default defineConfig((): UserConfig => {
2424
conditions: ["cursorless:bundler"],
2525
},
2626

27-
plugins: [preact()],
27+
plugins: [purgeCss({})],
2828
};
2929
});

0 commit comments

Comments
 (0)