11import { defineConfig } from 'vite' ;
22import * as path from 'path' ;
33import AutoImport from 'unplugin-auto-import/vite' ;
4- import babel from 'vite-plugin-babel' ;
54import commonjs from '@rollup/plugin-commonjs' ;
65import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js' ;
76import dts from 'vite-plugin-dts' ;
@@ -12,9 +11,12 @@ import vue from '@vitejs/plugin-vue';
1211import vuetify , { transformAssetUrls } from 'vite-plugin-vuetify' ;
1312import { viteStaticCopy } from 'vite-plugin-static-copy' ;
1413
14+ const scopedPackageName = pkg . name ;
15+ const packageName = scopedPackageName . split ( '/' ) [ 1 ] ;
16+
1517
1618const banner = `/**
17- * @name ${ pkg . name }
19+ * @name ${ scopedPackageName }
1820 * @version ${ pkg . version }
1921 * @description ${ pkg . description }
2022 * @author ${ pkg . author }
@@ -25,20 +27,18 @@ const banner = `/**
2527 */
2628` ;
2729
28- const pkgName = 'vuetify-drilldown-table' ;
29-
3030export default defineConfig ( {
3131 publicDir : false ,
3232 build : {
3333 lib : {
3434 entry : './src/plugin/index.ts' ,
35- name : pkgName ,
35+ name : packageName ,
3636 formats : [ 'es' , 'cjs' ] ,
37- fileName : format => `${ pkgName } .${ format } .js` ,
37+ fileName : format => `${ packageName } .${ format } .js` ,
3838 } ,
3939 rollupOptions : {
4040 input : {
41- main : path . resolve ( __dirname , './src/index.ts' )
41+ main : path . resolve ( __dirname , './src/plugin/ index.ts' )
4242 } ,
4343 external : [
4444 ...Object . keys ( pkg . dependencies || { } ) ,
@@ -49,7 +49,6 @@ export default defineConfig({
4949 } ,
5050 } ,
5151 plugins : [
52- babel ( ) ,
5352 commonjs ( ) ,
5453 AutoImport ( {
5554 dts : false ,
@@ -85,7 +84,11 @@ export default defineConfig({
8584 } ,
8685 ]
8786 } ) ,
88- terser ( ) ,
87+ terser ( {
88+ compress : {
89+ drop_console : [ 'log' ] ,
90+ } ,
91+ } ) ,
8992 ] ,
9093 resolve : {
9194 alias : {
@@ -94,6 +97,7 @@ export default defineConfig({
9497 '@composables' : path . resolve ( __dirname , './src/plugin/composables' ) ,
9598 '@plugin' : path . resolve ( __dirname , './src/plugin' ) ,
9699 '@root' : path . resolve ( __dirname , './' ) ,
100+ '@slots' : path . resolve ( __dirname , './src/plugin/slots' ) ,
97101 '@types' : path . resolve ( __dirname , './src/plugin/types' ) ,
98102 '@utils' : path . resolve ( __dirname , './src/plugin/utils' ) ,
99103 } ,
0 commit comments