Skip to content

Commit e624cd9

Browse files
Fix build on windows (#94)
* fix: generate correct font paths on windows and use cross-env for cross platform environment variables * formatting --------- Co-authored-by: Brendan Allan <[email protected]>
1 parent c496016 commit e624cd9

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "module",
44
"private": "true",
55
"scripts": {
6-
"dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" VITE_SOLIDBASE_DEV=true vinxi dev",
7-
"build": "NODE_OPTIONS=\"--max-old-space-size=8192\" vinxi build",
6+
"dev": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" VITE_SOLIDBASE_DEV=true vinxi dev",
7+
"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" vinxi build",
88
"start": "vinxi start"
99
},
1010
"dependencies": {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"@types/mdast": "^4.0.4",
101101
"@types/resolve": "^1.20.6",
102102
"@types/unist": "^3.0.3",
103+
"cross-env": "^7.0.3",
103104
"esbuild": "^0.25.2",
104105
"glob": "^11.0.1",
105106
"mdast": "^3.0.0",

pnpm-lock.yaml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/default-theme/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ const defaultTheme: ThemeDefinition<DefaultThemeConfig> = defineTheme({
6565
load(id) {
6666
if (id.startsWith("virtual:solidbase/default-theme/fonts.css"))
6767
return filteredFonts
68-
.map((font) => `@import url(${fileURLToPath(font.cssPath)});`)
68+
.map(
69+
(font) =>
70+
`@import url(${fileURLToPath(font.cssPath, { windows: false })});`,
71+
)
6972
.join("\n");
7073
if (id.startsWith("\0virtual:solidbase/default-theme/fonts")) {
7174
const preloadFonts = filteredFonts.map((font, i) => {
7275
const pathIdent = `font_${i}`;
7376
return {
7477
pathIdent,
75-
import: `import ${pathIdent} from "${fileURLToPath(font.preloadFontPath)}?url";`,
78+
import: `import ${pathIdent} from "${fileURLToPath(font.preloadFontPath, { windows: false })}?url";`,
7679
type: font.fontType,
7780
};
7881
});

0 commit comments

Comments
 (0)