File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 11import { glob } from "glob" ;
2+ import chalk from "chalk" ;
23import { execSync } from "child_process" ;
34import path from "path" ;
45import fs from "fs" ;
56
67const files = glob . sync ( "src/assets/js/*.js" ) ;
8+ console . log (
9+ `${ chalk . gray ( `[` ) } ${ chalk . green ( `Ew` ) } ${ chalk . gray ( `/Terser]` ) } ` ,
10+ chalk . white ( `Minifying ${ files . length } file(s)` )
11+ ) ;
712for ( const file of files ) {
813 const out = path . join ( "public/js" , path . basename ( file ) ) ;
914 fs . mkdirSync ( path . dirname ( out ) , { recursive : true } ) ;
1015 execSync ( `terser "${ file } " -o "${ out } " -c -m` ) ;
11- console . log ( `Minified: ${ file } -> ${ out } ` ) ;
12- }
16+ console . log (
17+ `${ chalk . gray ( `[` ) } ${ chalk . green ( `Ew` ) } ${ chalk . gray ( `/Terser]` ) } ` ,
18+ chalk . white ( `Writing ${ out } ` ) ,
19+ chalk . gray ( `from ${ file } ` )
20+ ) ;
21+ }
22+ console . log (
23+ `${ chalk . gray ( `[` ) } ${ chalk . green ( `Ew` ) } ${ chalk . gray ( `/Terser]` ) } ` ,
24+ chalk . white ( `Minification complete ${ files . length } file(s)` )
25+ ) ;
You can’t perform that action at this time.
0 commit comments