-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.js
58 lines (53 loc) · 1.34 KB
/
vite.config.js
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
import {defineConfig} from 'vite';
import {resolve} from 'path';
const prefix = `monaco-editor/esm/vs`;
const isDebug = process.env.NODE_ENV === 'debug';
const bundle = process.env.BUNDLE;
const PROSEMIRROR_BUNDLE = resolve(
__dirname,
'src/dyad_app/web_components/prosemirror_bundle.ts',
);
const input = [];
if (!bundle) {
input.push(
resolve(__dirname, 'src/dyad_app/web_components/index.ts'),
PROSEMIRROR_BUNDLE,
);
}
if (bundle === 'prosemirror') {
input.push(PROSEMIRROR_BUNDLE);
}
export default defineConfig({
base: '/static/build/',
build: {
target: 'modules',
minify: false,
sourcemap: isDebug,
reportCompressedSize: false,
// lib: {
// entry: resolve(__dirname, 'src/dyad_app/web_components/index.ts'),
// formats: ['es'],
// fileName: 'index',
// },
// sourcemap: 'inline',
outDir: 'src/dyad_app/static/build',
rollupOptions: {
input,
preserveEntrySignatures: 'strict',
output: {
entryFileNames: '[name].js',
assetFileNames: '[name][extname]',
manualChunks: {
// Split vendor modules into separate chunks to make
// build faster (and hopefully lazy load later)
'vendor': ['monaco-editor'],
},
},
},
emptyOutDir: !bundle,
},
plugins: [],
resolve: {
browser: true,
},
});