@joystick.js/cli-canary 0.0.0-canary.1645 → 0.0.0-canary.1646

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import s from"fs";import f from"esbuild";import r from"../path_exists.js";const{readFile:a,writeFile:c}=s.promises,n=async(i="")=>{if(await r(i)){const e=await a(i,"utf-8");console.log(i);const o=await f.transform(e,{minifyWhitespace:!0}).catch(t=>{console.warn(t)});o?.code&&await c(i,o.code)}};var w=n;export{w as default};
1
+ import f from"fs";import{minify as s}from"terser";import a from"../path_exists.js";const{readFile:c,writeFile:n}=f.promises,r=async(i="")=>{if(await a(i)){const e=await c(i,"utf-8");console.log(i);const o=await s(e).catch(t=>{console.warn(t)});o?.code&&await n(i,o.code)}};var d=r;export{d as default};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@joystick.js/cli-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.1645",
5
- "canary_version": "0.0.0-canary.1644",
4
+ "version": "0.0.0-canary.1646",
5
+ "canary_version": "0.0.0-canary.1645",
6
6
  "description": "The CLI for Joystick.",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
@@ -31,6 +31,7 @@
31
31
  "node-fetch": "^3.3.2",
32
32
  "pg": "^8.11.3",
33
33
  "query-string": "^8.1.0",
34
+ "terser": "^5.31.6",
34
35
  "ws": "^8.15.1"
35
36
  }
36
37
  }
@@ -1,5 +1,5 @@
1
1
  import fs from "fs";
2
- import esbuild from "esbuild";
2
+ import { minify } from "terser";
3
3
  import path_exists from "../path_exists.js";
4
4
 
5
5
  const { readFile, writeFile } = fs.promises;
@@ -8,11 +8,7 @@ const minify_file = async (path = "") => {
8
8
  if (await path_exists(path)) {
9
9
  const file = await readFile(path, "utf-8");
10
10
  console.log(path);
11
- const minified = await esbuild.transform(file, {
12
- minifyWhitespace: true,
13
- // minifyIdentifiers: true,
14
- // minifySyntax: true,
15
- }).catch((error) => {
11
+ const minified = await minify(file).catch((error) => {
16
12
  console.warn(error);
17
13
  });
18
14