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 1414 - windows-latest
1515 - macos-latest
1616 - ubuntu-latest
17- - macos-11 # arm64
17+ # - macos-11 # arm64
1818 d :
1919 - " ldc-1.28.0"
2020 node :
Original file line number Diff line number Diff line change 11import { execFile } from "child_process"
2+ import { readFile , writeFile } from "fs/promises" ;
23import { join } from "path"
34
45/**
@@ -10,6 +11,17 @@ import { join } from "path"
1011 * @throws {Promise<string | Error> } The promise is rejected with the reason for failure
1112 */
1213export 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+
1325 const filesNum = files . length
1426 if ( filesNum === 0 ) {
1527 return Promise . resolve ( )
You can’t perform that action at this time.
0 commit comments