Mercurial > code > home > repos > streamed-graph
annotate vite.config.ts @ 103:f12feced00ce
WIP rewriting Layout
author | drewp@bigasterisk.com |
---|---|
date | Sat, 12 Mar 2022 00:42:00 -0800 |
parents | 76c1a29a328f |
children | 73a70d00fb74 |
rev | line source |
---|---|
101
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
1 import { defineConfig, UserConfigExport } from "vite"; |
99 | 2 |
101
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
3 const config: UserConfigExport = { |
99 | 4 base: "https://bigasterisk.com/reposyncDev/", |
5 server: { | |
6 host: "0.0.0.0", | |
7 port: 8001, | |
8 hmr: { port: 443 }, | |
9 fs: { | |
10 allow: ["src", "node_modules", "."], | |
11 }, | |
12 }, | |
13 build: { | |
101
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
14 target: "esnext", |
99 | 15 lib: { |
16 entry: "src/index.ts", | |
17 formats: ["es"], | |
18 }, | |
19 rollupOptions: { | |
20 external: /^lit/, | |
21 }, | |
22 }, | |
23 resolve: { | |
24 alias: [{ find: "rdf-canonize-native", replacement: "" }], | |
25 }, | |
26 define: { | |
101
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
27 global: {}, |
99 | 28 }, |
101
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
29 }; |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
30 |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
31 export default defineConfig(({ command, mode }) => { |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
32 if (command === "serve") { |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
33 (config.define as any)["process"] = { env: {} }; |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
34 return config; |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
35 } else if (command === "build") { |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
36 return config; |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
37 } else { |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
38 throw new Error(command); |
76c1a29a328f
repo now demos itself, which runs better than using the nested demo/ project
drewp@bigasterisk.com
parents:
99
diff
changeset
|
39 } |
99 | 40 }); |