11/// <reference types="vitest" />
2- import { defineConfig } from 'vite'
3- import dts from 'vite-plugin-dts'
4- import vueJsx from '@vitejs/plugin-vue-jsx'
2+ import { defineConfig } from 'vite' ;
3+ import dts from 'vite-plugin-dts' ;
4+ import vueJsx from '@vitejs/plugin-vue-jsx' ;
55// https://vitejs.dev/config/
66export default defineConfig ( {
7- plugins : [ dts ( {
8- insertTypesEntry : true ,
9- cleanVueFileName : true ,
10- outputDir : 'lib' ,
11- staticImport : true ,
12- exclude : [ '**/__tests__/**/*' , '**/__mocks__/**/*' ] ,
13- } ) , vueJsx ( ) ] ,
7+ plugins : [
8+ dts ( {
9+ insertTypesEntry : true ,
10+ cleanVueFileName : true ,
11+ outputDir : 'lib' ,
12+ staticImport : true ,
13+ exclude : [ '**/__tests__/**/*' , '**/__mocks__/**/*' ] ,
14+ } ) ,
15+ vueJsx ( ) ,
16+ ] ,
1417
1518 test : {
1619 globals : true ,
@@ -19,25 +22,27 @@ export default defineConfig({
1922 web : [ / .[ t j ] s x $ / ] ,
2023 } ,
2124 } ,
22-
25+
2326 build : {
2427 lib : {
25- entry : 'src/index.ts' ,
28+ entry : [ 'src/index.ts' ] ,
2629 name : 'vue-lazy-load-image-component' ,
27- fileName : ' index' ,
30+ fileName : ( format ) => ` index. ${ format } .js` ,
2831 formats : [ 'es' ] ,
2932 } ,
3033
3134 rollupOptions : {
32- input : [ 'src/index.ts' , 'src/effects/index.css' ] ,
35+ // input: ['src/index.ts']
36+ input : { index : 'src/index.ts' } ,
3337 external : [ 'vue' ] ,
3438 output : {
3539 dir : 'lib' ,
3640 globals : {
37- vue : 'Vue'
41+ vue : 'Vue' ,
3842 } ,
39- format : 'es'
40- }
41- }
43+ format : 'es' ,
44+ assetFileNames : 'index.[ext]' ,
45+ } ,
46+ } ,
4247 } ,
43- } )
48+ } ) ;
0 commit comments