From 8b4b0a61401f6946a7d7ea30d1c6c5fe268f0040 Mon Sep 17 00:00:00 2001 From: Ben Heidemann Date: Sat, 10 Apr 2021 11:40:11 +0100 Subject: [PATCH] fix: when cwd is root and the tag is replaced, the resulting path should not begin with // --- src/webpack-plugin/processors.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/webpack-plugin/processors.js b/src/webpack-plugin/processors.js index 2a464bc..786aebd 100644 --- a/src/webpack-plugin/processors.js +++ b/src/webpack-plugin/processors.js @@ -9,7 +9,7 @@ module.exports = { if (!value) { return path.join(CWD, 'node_modules', 'filer'); } - return value.replace(ROOT_DIR_TAG, CWD); + return path.resolve(value.replace(ROOT_DIR_TAG, CWD)); }, }, shimsDir: { @@ -17,18 +17,18 @@ module.exports = { if (!value) { return path.join(CWD, 'node_modules', 'filer', 'shims'); } - return value.replace(ROOT_DIR_TAG, CWD); + return path.resolve(value.replace(ROOT_DIR_TAG, CWD)); } }, - shimFs: { default: true }, - shimPath: { default: true}, - fsProvider: { default: 'default'}, fsProviderDir: { process: function(value) { if (!value) { return path.join(CWD, 'node_modules', 'filer', 'shims', 'providers'); } - return value.replace(ROOT_DIR_TAG, CWD); + return path.resolve(value.replace(ROOT_DIR_TAG, CWD)); }, }, + shimFs: { default: true }, + shimPath: { default: true}, + fsProvider: { default: 'default'}, };