-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.ts
49 lines (47 loc) · 1.16 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/// <reference types="vitest/config" />
import viteDts from 'vite-plugin-dts'
import viteReact from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import packageJson from './package.json'
const banner = `
/*!
* ${packageJson.name} v${packageJson.version}
* ${packageJson.homepage}
*
* Includes @vue/reactivity
* https://github.com/vuejs/core/tree/main/packages/reactivity
*
* (c) 2021-present ${packageJson.author} and Veact contributors.
* Released under the ${packageJson.license} License.
*
* Date: ${new Date().toISOString()}
*/
`
export default defineConfig({
// https://github.com/qmhc/vite-plugin-dts
plugins: [viteReact(), viteDts({ rollupTypes: true })],
test: {
environment: 'happy-dom',
coverage: {
include: ['src/**/*'],
},
},
build: {
lib: {
entry: './src/index.ts',
name: 'veact',
fileName: 'veact',
},
rollupOptions: {
external: ['react', 'react-dom', '@vue/reactivity'],
output: {
banner: `\n${banner}\n`,
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'@vue/reactivity': 'VueReactivity',
},
},
},
},
})