-
Notifications
You must be signed in to change notification settings - Fork 425
Expand file tree
/
Copy pathvite.config.ts
More file actions
61 lines (59 loc) · 1.7 KB
/
Copy pathvite.config.ts
File metadata and controls
61 lines (59 loc) · 1.7 KB
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
import path from "node:path"
import { fileURLToPath } from "node:url"
import { defineConfig } from "vite";
import { imagePlugin } from "@solidjs/image/vite";
import { solidStart } from "../../../packages/start/src/config/index.js";
import { nitroV2Plugin } from "../../../packages/start-nitro-v2-vite-plugin/src";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [
imagePlugin({
local: {
sizes: [480, 600],
quality: 80,
output: ["avif"],
publicPath: "public",
},
remote: {
transformURL(url) {
return {
src: {
source: `https://picsum.photos/seed/${url}/1200/900.webp`,
width: 1080,
height: 760,
},
variants: [
{
path: `https://picsum.photos/seed/${url}/800/600.jpg`,
width: 800,
type: "image/jpeg",
},
{
path: `https://picsum.photos/seed/${url}/400/300.jpg`,
width: 400,
type: "image/jpeg",
},
{
path: `https://picsum.photos/seed/${url}/800/600.png`,
width: 800,
type: "image/png",
},
{
path: `https://picsum.photos/seed/${url}/400/300.png`,
width: 400,
type: "image/png",
},
],
};
},
},
}),
solidStart(),
nitroV2Plugin(),
],
// resolve: {
// alias: {
// "@solidjs/image": path.resolve(__dirname, "../../../packages/image/dist/index.js"),
// }
// }
});