11import fs from 'node:fs/promises' ;
2- import npath from 'node:path' ;
2+ import { join , relative } from 'node:path' ;
33
4- import getBuilds from './get-builds.js' ;
5- import maybeWrite from './maybe-write.js' ;
6- import setExt from './set-ext.js' ;
7- import sortObj from './sort-obj.js' ;
8- import writeBuffer from './write-buffer.js' ;
4+ import getBuilds from '#src/get-builds.js' ;
5+ import { getExt } from '#src/get-ext.js' ;
6+ import maybeWrite from '#src/maybe-write.js' ;
7+ import setExt from '#src/set-ext.js' ;
8+ import sortObj from '#src/sort-obj.js' ;
9+ import writeBuffer from '#src/write-buffer.js' ;
910
1011const { Buffer } = globalThis ;
1112
@@ -36,7 +37,7 @@ const saveBuild = async ({
3637 buffers . map ( async ( buffer , i ) => {
3738 const size = buffer . length ;
3839 const sourcePath =
39- i === 0 ? path : setExt ( path , `~${ i + 1 } ${ npath . extname ( path ) } ` ) ;
40+ i === 0 ? path : setExt ( path , `~${ i + 1 } ${ getExt ( path ) } ` ) ;
4041 try {
4142 const { didChange, targetPath } = await writeBuffer ( {
4243 buffer,
@@ -56,9 +57,7 @@ const getPaths = async pattern => {
5657 const paths = [ ] ;
5758 for await ( const dirent of fs . glob ( pattern , { withFileTypes : true } ) ) {
5859 if ( ! dirent . isDirectory ( ) ) {
59- paths . push (
60- npath . relative ( '.' , npath . join ( dirent . parentPath , dirent . name ) )
61- ) ;
60+ paths . push ( relative ( '.' , join ( dirent . parentPath , dirent . name ) ) ) ;
6261 }
6362 }
6463 return paths . sort ( ) ;
0 commit comments