File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1- import { extname , join } from 'node:path' ;
1+ import { extname } from 'node:path' ;
22
33import { globSync } from 'glob' ;
44
55import { cmdLine } from './commandLine' ;
66
77export const getFiles = ( ) : string [ ] =>
8- globSync ( join ( '**/*' ) , { cwd : cmdLine . sourcepath , nodir : true } )
8+ globSync ( '**/*' , { cwd : cmdLine . sourcepath , nodir : true } )
99 . filter ( ( filename ) => ! [ '.gz' , '.brottli' ] . includes ( extname ( filename ) ) )
1010 . sort ( ) ;
Original file line number Diff line number Diff line change 1+ /* eslint-disable unicorn/prefer-string-replace-all */
12import { createHash } from 'node:crypto' ;
23import { readFileSync , writeFileSync } from 'node:fs' ;
34import { join } from 'node:path' ;
@@ -28,7 +29,7 @@ for (const file of getFiles()) {
2829 if ( cmdLine [ 'no-gzip' ] ) {
2930 sources . push ( {
3031 index : sourceIndex ++ ,
31- filename : file ,
32+ filename : file . replace ( / \\ / g , '/' ) ,
3233 content : rawContent ,
3334 isGzip : false ,
3435 mime,
@@ -41,7 +42,7 @@ for (const file of getFiles()) {
4142 if ( rawContent . length > 100 && zipContent . length < rawContent . length * 0.85 ) {
4243 sources . push ( {
4344 index : sourceIndex ++ ,
44- filename : file ,
45+ filename : file . replace ( / \\ / g , '/' ) ,
4546 content : zipContent ,
4647 isGzip : true ,
4748 mime,
@@ -51,7 +52,7 @@ for (const file of getFiles()) {
5152 } else {
5253 sources . push ( {
5354 index : sourceIndex ++ ,
54- filename : file ,
55+ filename : file . replace ( / \\ / g , '/' ) ,
5556 content : rawContent ,
5657 isGzip : false ,
5758 mime,
You can’t perform that action at this time.
0 commit comments