diff --git a/fix-sw.bash b/fix-sw.bash new file mode 100755 index 0000000..a718e34 --- /dev/null +++ b/fix-sw.bash @@ -0,0 +1,6 @@ +importFile=$(grep -Po '(?<=await import\()(.+)\"' dist/sw.js) +echo "Captured ${importFile}" +ESCAPED_REPLACE=$(printf '%s\n' "$importFile" | sed -e 's/[\/&]/\\&/g') +sed -i -e '1s/^/import { FileSystemWritableFileStream } from '${ESCAPED_REPLACE}';\n/' \ + -e 's/.*await import.*/\/\//' \ + -e 's/return new t(await this\[ee\]\.createWritable(e));/return new FileSystemWritableFileStream(await this\[ee\]\.createWritable(e));/' dist/sw.js diff --git a/index.html b/index.html index 3b8762c..4e34c04 100644 --- a/index.html +++ b/index.html @@ -1,21 +1,23 @@ - + +
+ + + + + + + +