We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
./bin/minify.js
1 parent e583eb1 commit 1d671c1Copy full SHA for 1d671c1
1 file changed
bin/minify.js
@@ -0,0 +1,12 @@
1
+import { glob } from "glob";
2
+import { execSync } from "child_process";
3
+import path from "path";
4
+import fs from "fs";
5
+
6
+const files = glob.sync("src/assets/js/*.js");
7
+for (const file of files) {
8
+ const out = path.join("public/js", path.basename(file));
9
+ fs.mkdirSync(path.dirname(out), { recursive: true });
10
+ execSync(`terser "${file}" -o "${out}" -c -m`);
11
+ console.log(`Minified: ${file} -> ${out}`);
12
+}
0 commit comments