-
Notifications
You must be signed in to change notification settings - Fork 287
Expand file tree
/
Copy pathvite.shared.config.js
More file actions
37 lines (34 loc) · 952 Bytes
/
Copy pathvite.shared.config.js
File metadata and controls
37 lines (34 loc) · 952 Bytes
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
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import {
SUB_STORE_PATH,
subStoreTransformPlugin,
} from './vite.substore-transform.js';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export function createSharedResolveConfig() {
return {
alias: {
'@': path.join(SUB_STORE_PATH, 'src'),
},
};
}
export function createDashboardBuildParts() {
return {
plugins: [
tailwindcss(),
react(),
subStoreTransformPlugin(),
],
resolve: createSharedResolveConfig(),
optimizeDeps: {
include: ['react', 'react-dom', 'jose'],
},
assetsDir: 'dashboard/assets',
input: {
dashboard: path.join(__dirname, 'dashboard/index.html'),
},
external: ['net'],
};
}