Skip to content

Commit

Permalink
1.1.2 optimize template.js
Browse files Browse the repository at this point in the history
  • Loading branch information
bddjr committed Dec 29, 2024
1 parent 9e7afd6 commit dd069b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-singlefile-compression",
"version": "1.1.1",
"version": "1.1.2",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down
5 changes: 2 additions & 3 deletions src/template.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//@ts-nocheck

fetch("data:application/gzip;base64,{<script>}")
.then(r => r.blob())
.then(b => new Response(
b.stream().pipeThrough(new DecompressionStream("gzip")),
.then(r => new Response(
r.body.pipeThrough(new DecompressionStream("gzip")),
{ headers: { "Content-Type": "text/javascript" } }
).blob())
.then(b =>
Expand Down

0 comments on commit dd069b9

Please sign in to comment.