Open davay42 opened 1 year ago
Here's my workaround using patch-package:
diff --git a/node_modules/app-root-path/index.js b/node_modules/app-root-path/index.js
index 7fd5bde..ad84c91 100644
--- a/node_modules/app-root-path/index.js
+++ b/node_modules/app-root-path/index.js
@@ -1,4 +1,4 @@
'use strict';
var lib = require('./lib/app-root-path.js');
-module.exports = lib(__dirname);
\ No newline at end of file
+module.exports = lib(typeof __dirname === 'undefined' ? process.cwd() : __dirname);
Simply put this inside the file patches/app-root-path+3.1.0.patch
and run npx patch-package
.
Be advised that I haven't fully tested this solution, so I don't know what the implications of using process.cwd()
are.
I try using the lib in my project to fix Windows builds via GitHub actions. Otherwise my projects build fine.
Seems like the lib isn't compatible with ES modules setup...
Here's the repo https://github.com/davay42/vitepress-pages