Skip to content

Commit

Permalink
fix: preprocessor argument doesn't work with Windows paths #490 (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
ooker777 authored Jul 11, 2024
1 parent b6f9565 commit 52109e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { readFile } from 'node:fs/promises';
import * as fs from 'fs-extra';
import parseArgs from 'yargs-parser';
import path from 'node:path';
import url from 'node:url';
import url, { pathToFileURL } from 'node:url';
import { globSync } from 'glob';
import { isDirectory, isFile, isAbsoluteURL, tryReadJson5Configs, loadJSON } from './util.js';

const require = createRequire(import.meta.url);

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -112,7 +111,7 @@ export const getFaviconPath = async () => {

export const getPreprocessor = async preprocessor => {
if (preprocessor) {
const { default: defaultFunc } = await import(preprocessor);
const { default: defaultFunc } = await import(pathToFileURL(preprocessor));
return defaultFunc;
}

Expand Down

0 comments on commit 52109e7

Please sign in to comment.