File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
packages/@vue/cli-service Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ class SafariNomoduleFixPlugin {
2323 if ( ! needsSafariFix ) {
2424 return
2525 }
26+ const { RawSource } = compiler . webpack
27+ ? compiler . webpack . sources
28+ : require ( 'webpack-sources' )
2629
2730 const ID = 'SafariNomoduleFixPlugin'
2831 compiler . hooks . compilation . tap ( ID , compilation => {
@@ -40,14 +43,7 @@ class SafariNomoduleFixPlugin {
4043 // inject the fix as an external script
4144 const safariFixPath = path . join ( this . jsDirectory , 'safari-nomodule-fix.js' )
4245 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 )
5147 scriptTag = {
5248 tagName : 'script' ,
5349 closeTag : true ,
Original file line number Diff line number Diff line change 8383 },
8484 "peerDependencies" : {
8585 "@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" : " *"
8788 },
8889 "peerDependenciesMeta" : {
8990 "@vue/compiler-sfc" : {
You can’t perform that action at this time.
0 commit comments