Skip to content

Commit

Permalink
fix: transform file config file path to url (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedeya authored Aug 29, 2023
1 parent 3ca86e0 commit e98ccd1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import {
createSitemapFiles,
deleteOldSitemaps
} from './files';

const dir = path.resolve(process.cwd());
import { pathToFileURL } from 'url';

const findConfig = () => {
const configPath = path.join(dir, 'remix-sitemap.config.js');
const configPath = path.resolve(process.cwd(), 'remix-sitemap.config.js');

if (fs.existsSync(configPath)) return configPath;
if (fs.existsSync(configPath)) return pathToFileURL(configPath).toString();
};

async function main() {
Expand Down

0 comments on commit e98ccd1

Please sign in to comment.