forked from Quorafind/Obsidian-Thino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
31 lines (30 loc) · 916 Bytes
/
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
import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// import reactSvgPlugin from 'vite-plugin-react-svg';
import svgr from '@honkhonk/vite-plugin-svgr';
export default defineConfig(({ mode }) => {
return {
plugins: [react(), svgr({ keepEmittedAssets: true })],
build: {
sourcemap: mode === 'development' ? 'inline' : false,
minify: false,
// Use Vite lib mode https://vitejs.dev/guide/build.html#library-mode
lib: {
entry: path.resolve(__dirname, './src/index.ts'),
formats: ['cjs'],
},
rollupOptions: {
output: {
// Overwrite default Vite output fileName
entryFileNames: 'main.js',
assetFileNames: 'styles.css',
},
external: ['obsidian'],
},
// Use root as the output dir
emptyOutDir: false,
outDir: '.',
},
};
});