File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 14
14
- windows-latest
15
15
- macos-latest
16
16
- ubuntu-latest
17
- - macos-11 # arm64
17
+ # - macos-11 # arm64
18
18
d :
19
19
- " ldc-1.28.0"
20
20
node :
Original file line number Diff line number Diff line change 1
1
import { execFile } from "child_process"
2
+ import { readFile , writeFile } from "fs/promises" ;
2
3
import { join } from "path"
3
4
4
5
/**
@@ -10,6 +11,17 @@ import { join } from "path"
10
11
* @throws {Promise<string | Error> } The promise is rejected with the reason for failure
11
12
*/
12
13
export async function minifyFiles ( files : string [ ] , hasComment = false ) : Promise < void > {
14
+ if ( process . platform === "darwin" && process . arch === "arm64" ) {
15
+ // fallback to jasonminify due to missing ARM64 binaries
16
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
17
+ const jsonminify = require ( "jsonminify" ) ;
18
+ files . map ( async ( file ) => {
19
+ const jsonString = await readFile ( file , 'utf8' ) ;
20
+ const minifiedJsonString = jsonminify ( jsonString ) as string ;
21
+ await writeFile ( file , minifiedJsonString ) ;
22
+ } )
23
+ }
24
+
13
25
const filesNum = files . length
14
26
if ( filesNum === 0 ) {
15
27
return Promise . resolve ( )
You can’t perform that action at this time.
0 commit comments