File tree Expand file tree Collapse file tree 3 files changed +222
-11
lines changed
Expand file tree Collapse file tree 3 files changed +222
-11
lines changed Original file line number Diff line number Diff line change 2929 "@11ty/eleventy" : " >=0.5.4"
3030 },
3131 "dependencies" : {
32+ "glob" : " ^10.3.3" ,
3233 "lodash" : " ^4.17.21" ,
33- "svg-sprite" : " 2.0.0"
34+ "svg-sprite" : " 2.0.0" ,
35+ "vinyl" : " ^3.0.0"
3436 }
3537}
Original file line number Diff line number Diff line change 1+ const { glob } = require ( 'glob' ) ;
12const fs = require ( 'fs' ) ;
2- const libUtils = require ( './lib-utils' ) ;
33const path = require ( 'path' ) ;
4+ const SVGSpriter = require ( 'svg-sprite' ) ;
45const util = require ( 'util' ) ;
5- const glob = require ( 'glob' ) ;
66const Vinyl = require ( 'vinyl' ) ;
7- const SVGSpriter = require ( 'svg-sprite' ) ;
7+
8+ const libUtils = require ( './lib-utils' ) ;
89
910let spriteCache = { } ;
1011
@@ -21,8 +22,7 @@ class SVGSprite {
2122
2223 async compile ( ) {
2324 // Get all SVG files in working directory
24- const getFiles = util . promisify ( glob ) ;
25- const files = await getFiles ( '**/*.svg' , { cwd : this . cwd } ) ;
25+ const files = await glob ( `**/*.svg` , { cwd : this . cwd } ) ;
2626 const newCacheKey = files . map ( file => `${ file } :${ fs . statSync ( path . join ( this . cwd , file ) ) . mtimeMs } ` ) . join ( "|" ) ;
2727 // Note: Replace custom file watching with chokidar if there are bugs/limitations.
2828 // https://github.com/paulmillr/chokidar
You can’t perform that action at this time.
0 commit comments