-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.config.ts
67 lines (62 loc) · 1.74 KB
/
app.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { defineConfig } from "@solidjs/start/config";
import path from "node:path";
import compileTime from "vite-plugin-compile-time";
import solidSvg from "vite-plugin-solid-svg";
import tsconfig from "./tsconfig.json";
import { linariaVitePlugin } from "./vite/linariaVitePlugin";
import { viteMarkdownPlugin } from "./vite/markdown/viteMarkdownPlugin";
import { viteImagePlugin } from "./vite/viteImagePlugin";
// @ts-ignore
import babelPluginLazyPlus from "solid-lazy-plus/babel";
const babelPluginLabels = [
"solid-labels/babel",
{ dev: process.env.NODE_ENV == "development" },
];
export default defineConfig({
devOverlay: false,
server: {
baseURL: process.env.BASE_PATH,
static: true,
prerender: {
failOnError: true,
routes: ["/"],
crawlLinks: true,
},
},
solid: {
babel: {
plugins: [babelPluginLabels, babelPluginLazyPlus],
},
// the `solid` field is incorrectly typed
...({} as any),
},
extensions: ["mdx", "md"],
vite(options) {
return {
css: { postcss: "./postcss.config.js" },
server: {
port: 3000,
warmup: { clientFiles: ["./src/app.tsx"] },
},
build: { sourcemap: true },
resolve: {
alias: Object.fromEntries(
Object.entries(tsconfig.compilerOptions.paths).map(([key, value]) => [
key.replace(/\/\*$/, ""),
path.join(process.cwd(), value[0].replace(/\/\*$/, "")),
])
),
},
plugins: [
viteImagePlugin(),
compileTime(),
solidSvg(),
viteMarkdownPlugin(),
linariaVitePlugin({
include: [/\/src\//],
exclude: [/solid-refresh/, /\/@babel\/runtime\//, /\.import\./],
}) as any,
],
};
},
});