Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / import-fresh / index.js
index 425ed98c42f68ebb48e2b9d2622109c9f360a861..0a4c5d52f6d32274d3032c2c7cf513ac8d1a81af 100644 (file)
@@ -10,7 +10,8 @@ module.exports = moduleId => {
 
        const parentPath = parentModule(__filename);
 
-       const filePath = resolveFrom(path.dirname(parentPath), moduleId);
+       const cwd = parentPath ? path.dirname(parentPath) : __dirname;
+       const filePath = resolveFrom(cwd, moduleId);
 
        const oldModule = require.cache[filePath];
        // Delete itself from module parent