File tree 2 files changed +6
-9
lines changed
packages/@vue/cli-service
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ class SafariNomoduleFixPlugin {
23
23
if ( ! needsSafariFix ) {
24
24
return
25
25
}
26
+ const { RawSource } = compiler . webpack
27
+ ? compiler . webpack . sources
28
+ : require ( 'webpack-sources' )
26
29
27
30
const ID = 'SafariNomoduleFixPlugin'
28
31
compiler . hooks . compilation . tap ( ID , compilation => {
@@ -40,14 +43,7 @@ class SafariNomoduleFixPlugin {
40
43
// inject the fix as an external script
41
44
const safariFixPath = path . join ( this . jsDirectory , 'safari-nomodule-fix.js' )
42
45
const fullSafariFixPath = path . join ( compilation . options . output . publicPath , safariFixPath )
43
- compilation . assets [ safariFixPath ] = {
44
- source : function ( ) {
45
- return Buffer . from ( safariFix )
46
- } ,
47
- size : function ( ) {
48
- return Buffer . byteLength ( safariFix )
49
- }
50
- }
46
+ compilation . assets [ safariFixPath ] = new RawSource ( safariFix )
51
47
scriptTag = {
52
48
tagName : 'script' ,
53
49
closeTag : true ,
Original file line number Diff line number Diff line change 83
83
},
84
84
"peerDependencies" : {
85
85
"@vue/compiler-sfc" : " ^3.0.0-beta.14" ,
86
- "vue-template-compiler" : " ^2.0.0"
86
+ "vue-template-compiler" : " ^2.0.0" ,
87
+ "webpack-sources" : " *"
87
88
},
88
89
"peerDependenciesMeta" : {
89
90
"@vue/compiler-sfc" : {
You can’t perform that action at this time.
0 commit comments