From 0f5e17bcaa908167d0ae64de55c07ecc6efd52d6 Mon Sep 17 00:00:00 2001 From: Eugene Date: Tue, 27 Oct 2020 16:31:28 +0300 Subject: [PATCH] fix: use normalize for glob path --- src/core/config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/config.ts b/src/core/config.ts index 4ec82d0..e7bbb37 100644 --- a/src/core/config.ts +++ b/src/core/config.ts @@ -1,5 +1,6 @@ import { Platform } from 'style-dictionary' import fg from 'fast-glob' +import normalize from 'normalize-path' export type Config = { entry: Record @@ -12,9 +13,11 @@ export async function loadConfig( filters: { entries?: string[]; outputs?: string[]; [key: string]: any }, ): Promise { filters - const resolvedPath = fg.sync(path) + const resolvedPath = fg.sync(normalize(path)) if (resolvedPath.length === 0) { - throw new Error(`Cannot load config from "${path}", please check path or file are exists.`) + throw new Error( + `Cannot load config from "${normalize(path)}", please check path or file are exists.`, + ) } const config: Config = require(resolvedPath[0]) if (filters.entries !== undefined || filters.outputs !== undefined) {