-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
64 lines (63 loc) · 1.62 KB
/
vite.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
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import og from 'vite-plugin-open-graph';
export default defineConfig({
plugins: [
react({
babel: {
plugins: ['babel-plugin-react-compiler', {}],
},
}),
og({
basic: {
siteName: 'React Playground',
title: 'React Playground',
url: 'https://repl.lmmmmmm.dev',
image: 'https://repl.lmmmmmm.dev/og.png',
description: 'An interactive React playground',
},
twitter: {
card: 'summary_large_image',
title: 'React Playground',
imageAlt: 'React REPL',
image: 'https://repl.lmmmmmm.dev/og.png',
description: 'An interactive React playground',
},
}),
],
resolve: {
alias: {
'~': resolve(__dirname, 'src'),
},
},
optimizeDeps: {
include: ['@babel/standalone'],
},
worker: {
format: 'es',
},
define: {
__BUILD_TIME__: JSON.stringify(
new Date().toLocaleString(),
),
},
build: {
target: 'esnext',
rollupOptions: {
output: {
manualChunks: {
shiki: ['shiki', '@shikijs/monaco'],
editorWorker: ['monaco-editor/esm/vs/editor/editor.worker.js'],
monaco: ['monaco-editor'],
resizablePanel: ['react-resizable-panels'],
prettier: ['prettier'],
prettierPostcss: ['prettier/parser-postcss'],
prettierTS: ['prettier/plugins/typescript'],
prettierBabel: ['prettier/plugins/babel'],
prettierEstree: ['prettier/plugins/estree'],
},
},
},
},
});