-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
48 lines (44 loc) · 1.23 KB
/
index.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
// noinspection JSUnusedGlobalSymbols
import autoprefixer from "autoprefixer";
import {defineConfig as viteConfig, UserConfigExport} from "vite";
import {deepmerge} from "deepmerge-ts";
const osm_config: UserConfigExport = {
assetsInclude: ['js', 'jpg', 'png', 'webp', 'txt'],
build: {
target: 'esnext',
// rollupOptions: {
// // output: {
// // // manualChunks: {},
// // entryFileNames: '[name].js',
// // chunkFileNames: '[name].js',
// // assetFileNames: '[name].[ext]'
// // },
// preserveEntrySignatures: 'allow-extension'
// }
},
css: {
postcss: {
plugins: [autoprefixer()]
}
},
esbuild: {
jsxFactory: 'm',
jsxFragment: "'['"
}
};
/**
* Returns the merged config
*
* @param config Config to merge with the default common one
*/
export default function osmConfig(config: UserConfigExport = {}) {
return deepmerge(osm_config, config);
}
/**
* Returns the vite config object
*
* @param config Config to merge with the default common one
*/
export function defineConfig(config: UserConfigExport = {}) {
return viteConfig(osmConfig(config));
}