File tree Expand file tree Collapse file tree 4 files changed +501
-11
lines changed
Expand file tree Collapse file tree 4 files changed +501
-11
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ export default function (eleventyConfig) {
6363 eleventyConfig . addPassthroughCopy ( {
6464 "src/assets/*.pdf" : "assets" ,
6565 "src/assets/images" : "images" ,
66- "src/assets/js/*" : "js" ,
6766 "src/admin/*" : "admin" ,
6867 "settings.json" : "settings.json" ,
6968 "src/robots.txt" : "robots.txt"
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments