@@ -11,37 +11,50 @@ import vue from '@vitejs/plugin-vue';
11
11
import vuetify , { transformAssetUrls } from 'vite-plugin-vuetify' ;
12
12
import { viteStaticCopy } from 'vite-plugin-static-copy' ;
13
13
14
+ const scopedPackageName = pkg . name ;
15
+ const packageName = scopedPackageName . split ( '/' ) [ 1 ] ;
16
+
14
17
15
18
const banner = `/**
16
- * @name ${ pkg . name }
19
+ * @name ${ scopedPackageName }
17
20
* @version ${ pkg . version }
18
21
* @description ${ pkg . description }
19
22
* @author ${ pkg . author }
20
- * @copyright Copyright ${ new Date ( ) . getFullYear ( ) } , __USERNAME__
23
+ * @copyright Copyright ${ new Date ( ) . getFullYear ( ) } , WebDevNerdStuff
24
+ * @homepage ${ pkg . homepage }
25
+ * @repository ${ pkg . repository }
21
26
* @license ${ pkg . license } License
22
- */
27
+ */
23
28
` ;
24
- // * @homepage ${pkg.homepage}
25
- // * @repository ${pkg.repository}
26
29
27
30
export default defineConfig ( {
28
31
publicDir : false ,
29
32
build : {
30
33
lib : {
31
34
entry : './src/plugin/index.ts' ,
32
- name : pkg . name ,
35
+ name : packageName ,
33
36
formats : [ 'es' , 'cjs' ] ,
34
- fileName : format => `${ pkg . name } .${ format } .js` ,
37
+ fileName : format => `${ packageName } .${ format } .js` ,
35
38
} ,
36
39
rollupOptions : {
37
40
input : {
38
41
main : path . resolve ( __dirname , './src/plugin/index.ts' )
39
42
} ,
40
43
external : [
41
44
...Object . keys ( pkg . dependencies || { } ) ,
45
+ / ^ v u e t i f y ( $ | \/ .+ ) / ,
42
46
] ,
43
47
output : {
44
48
banner,
49
+ exports : 'named' ,
50
+ } ,
51
+ } ,
52
+ } ,
53
+ css : {
54
+ preprocessorOptions : {
55
+ scss : {
56
+ api : 'modern-compiler' , // or "modern", "legacy"
57
+ importers : [ ] ,
45
58
} ,
46
59
} ,
47
60
} ,
@@ -69,6 +82,7 @@ export default defineConfig({
69
82
} ) ,
70
83
vuetify ( {
71
84
autoImport : true ,
85
+ styles : 'none' ,
72
86
} ) ,
73
87
cssInjectedByJsPlugin ( { topExecutionPriority : false } ) ,
74
88
viteStaticCopy ( {
@@ -79,7 +93,11 @@ export default defineConfig({
79
93
} ,
80
94
]
81
95
} ) ,
82
- terser ( ) ,
96
+ terser ( {
97
+ compress : {
98
+ drop_console : [ 'log' ] ,
99
+ } ,
100
+ } ) ,
83
101
] ,
84
102
resolve : {
85
103
alias : {
0 commit comments