-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.dev.ts
More file actions
59 lines (51 loc) · 1.42 KB
/
vite.config.dev.ts
File metadata and controls
59 lines (51 loc) · 1.42 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
import { defineConfig } from 'vite';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
import {
makeDefaultViteBuildOptions,
makeViteEditorAlias,
makeViteEditorCSSOptions,
makeViteEditorPlugins,
} from '../../build-utils/vite-editor';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig({
plugins: makeViteEditorPlugins(),
appType: 'mpa',
esbuild: {
supported: {
'top-level-await': true,
},
},
define: {
'import.meta.env.VITE_DOCAUTH_ASSETS_BASE': JSON.stringify('/'),
'import.meta.env.VITE_DOCAUTH_BUILD_TIME': JSON.stringify(Math.floor(Date.now() / 1000).toString()),
'import.meta.env.VITE_DOCAUTH_VERSION_STR': JSON.stringify('dev'),
},
resolve: {
alias: {
...makeViteEditorAlias(),
'@nutrient-sdk/document-authoring': resolve(__dirname, 'vite-dev-shim.ts'),
},
},
publicDir: 'public',
server: {
fs: {
allow: ['../..'],
},
},
build: {
...makeDefaultViteBuildOptions(),
rollupOptions: {
input: {
'index.html': resolve(__dirname, 'index.html'),
'react.html': resolve(__dirname, 'react.html'),
'javascript.html': resolve(__dirname, 'javascript.html'),
'javascript-shared.html': resolve(__dirname, 'javascript-shared.html'),
'actions-and-toolbar.html': resolve(__dirname, 'actions-and-toolbar.html'),
},
},
chunkSizeWarningLimit: 2048,
},
...makeViteEditorCSSOptions(),
});