@@ -3,54 +3,46 @@ import dts from 'vite-plugin-dts'
33import svg from 'vite-svg-loader'
44import { defineConfig } from 'vitest/config'
55
6- export default defineConfig ( ( env ) => {
7- const demo = env . mode === 'demo'
6+ export default defineConfig ( {
7+ plugins : [ vue ( ) , svg ( ) , dts ( {
8+ tsconfigPath : './tsconfig.app.json' ,
9+ rollupTypes : true ,
10+ } ) ] ,
811
9- const plugins = [ vue ( ) , svg ( ) ]
10- if ( ! demo ) {
11- plugins . push ( dts ( {
12- tsconfigPath : './tsconfig.app.json' ,
13- rollupTypes : ! demo ,
14- } ) )
15- }
16-
17- return defineConfig ( {
18- base : demo ? process . env . VITE_BASE_URL : undefined ,
19- plugins,
20- build : {
21- minify : true ,
22- sourcemap : true ,
23- outDir : demo ? 'demo' : 'dist' ,
24- copyPublicDir : demo ,
25- lib : demo ? undefined :{
26- formats : [ 'es' ] ,
27- entry : 'lib/index.ts' ,
28- name : 'JuitTinyEdit' ,
29- fileName : 'index' ,
30- } ,
31- rollupOptions : {
32- external : [ 'vue' ] ,
33- output : {
34- globals : { vue : 'Vue' } ,
35- } ,
36- } ,
12+ build : {
13+ minify : true ,
14+ sourcemap : true ,
15+ outDir : 'dist' ,
16+ copyPublicDir : false ,
17+ lib : {
18+ formats : [ 'es' ] ,
19+ entry : 'lib/index.ts' ,
20+ name : 'JuitTinyEdit' ,
21+ fileName : 'index' ,
3722 } ,
38- test : {
39- globals : true ,
40- environment : 'jsdom' ,
41- include : [ 'test/**/*.test.ts' ] ,
42- coverage : {
43- provider : 'v8' ,
44- reporter : [ 'text' , 'html' ] ,
45- reportsDirectory : 'coverage' ,
46- cleanOnRerun : true ,
47- include : [ 'lib' ] ,
48- exclude : [
49- 'lib/**/*.test.ts' ,
50- 'lib/editor.vue' , // we always get 100% coverage???
51- ] ,
52- reportOnFailure : true ,
23+ rollupOptions : {
24+ external : [ 'vue' ] ,
25+ output : {
26+ globals : { vue : 'Vue' } ,
5327 } ,
5428 } ,
55- } )
29+ } ,
30+
31+ test : {
32+ globals : true ,
33+ environment : 'jsdom' ,
34+ include : [ 'test/**/*.test.ts' ] ,
35+ coverage : {
36+ provider : 'v8' ,
37+ reporter : [ 'text' , 'html' ] ,
38+ reportsDirectory : 'coverage' ,
39+ cleanOnRerun : true ,
40+ include : [ 'lib' ] ,
41+ exclude : [
42+ 'lib/**/*.test.ts' ,
43+ 'lib/editor.vue' , // we always get 100% coverage???
44+ ] ,
45+ reportOnFailure : true ,
46+ } ,
47+ } ,
5648} )
0 commit comments