File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -33,26 +33,12 @@ const BUILD_PLUGINS = [
3333 } ,
3434 writeBundle ( ) {
3535 const outputIndexHtml = path . join ( config . build . outDir , 'index.html' ) ;
36- const content =
36+ let content =
3737 GUIDE_FOR_FRONTEND + '\n' + fs . readFileSync ( outputIndexHtml , 'utf-8' ) ;
38- const deflator = new pako . Deflate ( {
38+ content = content . replace ( / \r / g, '' ) ; // remove windows-style line endings
39+ const compressed = pako . deflate ( content , {
3940 level : 9 ,
40- header : {
41- text : true ,
42- os : 0 ,
43- time : 0 ,
44- extra : [ ] ,
45- name : '' ,
46- comment : '' ,
47- hcrc : true ,
48- }
4941 } ) ;
50- deflator . push ( content , true ) ;
51- if ( deflator . err ) {
52- console . error ( deflator . msg ) ;
53- process . exit ( 1 ) ;
54- }
55- const compressed = deflator . result as Uint8Array ;
5642
5743 // because gzip header contains machine-specific info, we must remove these data from the header
5844 // timestamp
You can’t perform that action at this time.
0 commit comments