Skip to content

Commit

Permalink
Use path resolve instead of posix
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanpingle committed Aug 17, 2024
1 parent e217740 commit 24112f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/resolve-dirs-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { posix as pathUtils, isAbsolute } from 'path';
import { posix, isAbsolute, resolve } from 'path';

export default function resolveDirs(paths) {
const pathBaseDir = paths.map((path) => [
pathUtils.basename(path),
pathUtils.dirname(path),
posix.basename(path),
posix.dirname(path),
]);

return {
Expand All @@ -31,7 +31,7 @@ export default function resolveDirs(paths) {
throw new Error(`Couldn't find ${'./' + id}`);
}
if (isAbsolute(resolveResult.id)) return resolveResult.id;
return pathUtils.resolve(resolveResult.id);
return resolve(resolveResult.id);
},
};
}

0 comments on commit 24112f4

Please sign in to comment.