From 8d6a028f92f25796fd89d096c39cf7730ab9c756 Mon Sep 17 00:00:00 2001 From: Alexander Opran Date: Fri, 25 Oct 2019 10:57:04 +0300 Subject: [PATCH 1/2] Fix the config file path of windows while still using path.resolve. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 906d8137..968cc92d 100644 --- a/src/index.js +++ b/src/index.js @@ -52,7 +52,7 @@ class Purgecss { const pathConfig = typeof configFile === 'undefined' ? CONFIG_FILENAME : configFile let options try { - const t = path.resolve(process.cwd(), pathConfig) + const t = path.resolve(process.cwd(), pathConfig).replace(/\\/g, '/') options = require(t) } catch (e) { throw new Error(ERROR_CONFIG_FILE_LOADING + e.message) From 08f21992fbbc1b7cae8a654ff30501af043f4685 Mon Sep 17 00:00:00 2001 From: Alexander Opran Date: Fri, 25 Oct 2019 11:08:40 +0300 Subject: [PATCH 2/2] Replaced path.resolve with path.join in config loading. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 968cc92d..9c8a705a 100644 --- a/src/index.js +++ b/src/index.js @@ -52,7 +52,7 @@ class Purgecss { const pathConfig = typeof configFile === 'undefined' ? CONFIG_FILENAME : configFile let options try { - const t = path.resolve(process.cwd(), pathConfig).replace(/\\/g, '/') + const t = path.join(process.cwd(), pathConfig) options = require(t) } catch (e) { throw new Error(ERROR_CONFIG_FILE_LOADING + e.message)