File tree 3 files changed +35
-10
lines changed
3 files changed +35
-10
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ export default class Webpack4Cache {
55
55
input,
56
56
inputSourceMap,
57
57
extractedComments,
58
+ banner,
59
+ shebang,
58
60
} = cachedResult ;
59
61
60
62
if ( map ) {
@@ -70,6 +72,14 @@ export default class Webpack4Cache {
70
72
cachedResult . source = new RawSource ( code ) ;
71
73
}
72
74
75
+ if ( banner ) {
76
+ cachedResult . source = new ConcatSource (
77
+ shebang ? `${ shebang } \n` : '' ,
78
+ `/*! ${ banner } */\n` ,
79
+ cachedResult . source
80
+ ) ;
81
+ }
82
+
73
83
if ( extractedComments ) {
74
84
cachedResult . extractedCommentsSource = new RawSource ( extractedComments ) ;
75
85
}
@@ -105,6 +115,8 @@ export default class Webpack4Cache {
105
115
map : cacheData . map ,
106
116
input : cacheData . input ,
107
117
inputSourceMap : cacheData . inputSourceMap ,
118
+ banner : cacheData . banner ,
119
+ shebang : cacheData . shebang ,
108
120
} ;
109
121
110
122
if ( cacheData . extractedCommentsSource ) {
Original file line number Diff line number Diff line change @@ -323,6 +323,7 @@ class TerserPlugin {
323
323
324
324
let output = await cache . get ( cacheData , {
325
325
RawSource,
326
+ ConcatSource,
326
327
SourceMapSource,
327
328
} ) ;
328
329
@@ -433,6 +434,8 @@ class TerserPlugin {
433
434
`/*! ${ banner } */\n` ,
434
435
output . source
435
436
) ;
437
+ output . banner = banner ;
438
+ output . shebang = shebang ;
436
439
}
437
440
}
438
441
You can’t perform that action at this time.
0 commit comments