Skip to content

Commit 471bf87

Browse files
Add fix to packages
1 parent 769a3bf commit 471bf87

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"preferGlobal": true,
2020
"scripts": {
2121
"__preinstall": "cd LiaScript && npm i && npm run build:scorm1.2 && cp -r dist ../assets/scorm1.2",
22-
"build:assets": "npm run clean && npm run asset:scorm1.2 && npm run asset:scorm2004 && npm run asset:web && npm run asset:indexeddb && npm run asset:pdf && npm run asset:capacitor && npm run asset:logo",
22+
"build:assets": "npm run clean && npm run asset:scorm1.2 && npm run asset:scorm2004 && npm run asset:web && npm run asset:indexeddb && npm run asset:pdf && npm run asset:capacitor && npm run asset:logo && npm run fix:file",
2323
"clean": "rm -rf dist/assets/*",
2424
"asset:logo": "cp -r LiaScript/resources dist",
2525
"asset:web": "cd LiaScript && npm i && npm run build:base && cp -r dist ../dist/assets/web",
@@ -32,6 +32,7 @@
3232
"build:debug": "npx parcel build --target node --no-minify --log-level 5 src/index.ts",
3333
"run:moodle": "cd docker/moodle && docker-compose up",
3434
"run:ilias": "cd docker/ilias && docker-compose up",
35+
"fix:file": "find dist/ -type f -name \"*.js\" -exec sed -i 's_/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/_/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/\\/?[^/]+/_g' {} +",
3536
"shebang": "sed -i '1i #!/usr/bin/env node\\n' dist/index.js && chmod +x dist/index.js",
3637
"minify": "find dist -name \"*.js\" -print0 | xargs -0 -P 4 -I {} sh -c 'before=$(wc -c < {}); minify {} > {}.min && after=$(wc -c < {}.min); if [ ${after} -lt ${before} ]; then mv {}.min {}; reduction=$((${before}-${after})); percent=$(awk \"BEGIN {printf \\\"%.2f\\\", ${reduction}/${before}*100}\"); echo \"{} reduced from ${before} to ${after} bytes (${percent}% reduction)\"; else rm {}.min; echo \"{} no reduction achieved, file size unchanged\"; fi'"
3738
},

0 commit comments

Comments
 (0)