From 5d193c08922f5c4f30c8a4fbe8e623bd2f0ff84b Mon Sep 17 00:00:00 2001 From: ukriu <80760888+ukriu@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:19:47 +0530 Subject: [PATCH] Add package.json --- .gitignore | 2 ++ package.json | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .gitignore create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b4a2ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/* +pnpm-lock.yaml \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..0f8fa29 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "scripts": { + "minify:html": "find . -name '*.html' -exec npx html-minifier-terser --collapse-whitespace --remove-comments --minify-js true --minify-css true -o {} {} \\;", + "minify:css": "find . -name '*.css' -exec npx cleancss -o {} {} \\;", + "minify:js": "find . -name '*.js' -exec npx terser --compress --mangle --output {} -- {} \\;", + "minify:json": "find . -name '*.json' -exec sh -c 'npx json-minify < \"$1\" > \"$1.tmp\" && mv \"$1.tmp\" \"$1\"' _ {} \\;", + "minify": "npm run minify:html && npm run minify:css && npm run minify:js && npm run minify:json" + }, + "devDependencies": { + "html-minifier-terser": "*", + "clean-css-cli": "*", + "terser": "*", + "json-minify": "*" + } +} \ No newline at end of file