File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vite-plugin-banner" ,
3
3
"description" : " A banner plugin for Vite. Adds a banner to the top of each generated chunk." ,
4
- "version" : " 0.6.1 " ,
4
+ "version" : " 0.7.0 " ,
5
5
"author" :
" chengpeiquan <[email protected] >" ,
6
6
"license" : " MIT" ,
7
7
"homepage" : " https://github.com/chengpeiquan/vite-plugin-banner" ,
Original file line number Diff line number Diff line change @@ -60,20 +60,27 @@ export default function (
60
60
let data : string = fs . readFileSync ( filePath , {
61
61
encoding : 'utf8' ,
62
62
} )
63
+
63
64
let myContent : string =
64
65
typeof setContent === 'string' ? setContent : ''
65
66
if ( typeof setContent === 'function' ) {
66
67
myContent = setContent ( fileName )
67
68
if ( ! myContent ) return
68
69
}
70
+
69
71
// If the banner content has comment symbol, use it directly
70
- if ( myContent . includes ( '/*' ) || myContent . includes ( '*/' ) ) {
72
+ if (
73
+ myContent . includes ( '/*' ) ||
74
+ myContent . includes ( '*/' ) ||
75
+ ! pluginConfig . verify
76
+ ) {
71
77
data = `${ myContent } \n${ data } `
72
78
}
73
79
// Otherwise add comment symbol
74
80
else {
75
81
data = `/*! ${ myContent } */\n${ data } `
76
82
}
83
+
77
84
// Save
78
85
fs . writeFileSync ( filePath , data )
79
86
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments