-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvite.config.ts
35 lines (33 loc) · 985 Bytes
/
vite.config.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
/* eslint-disable @typescript-eslint/no-var-requires */
import { resolve, dirname } from 'path';
import { defineConfig } from 'vite';
// import dts from 'vite-plugin-dts';
const __dirname = dirname(__filename);
export default defineConfig({
build: {
target: 'es2020', // default is 'modules' which is a vite special value
sourcemap: 'hidden',
lib: {
entry: resolve(__dirname, 'src/typeahead-standalone.ts'),
name: 'typeahead',
fileName: (format) => `typeahead-standalone.${format}${format === 'umd' ? '.js' : '.mjs'}`,
},
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name == 'style.css') return 'basic.css';
return assetInfo.name;
},
},
},
},
test: {
include: ['**/*.spec.ts'],
globals: true,
},
server: {
open: '/demo/index.umd.html',
},
// This emits a types.d.ts within the dist/ folder
// plugins: [dts({ rollupTypes: true })],
});