Skip to content

Commit ba205f0

Browse files
anmonteiroswannodette
authored andcommitted
CLJS-1916: __dirname and __filename are not defined when compiling for Node.js with optimizations :none
1 parent 2f8a152 commit ba205f0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/cljs/cljs/bootstrap_node.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ function nodeGlobalRequire(file) {
8282
var _module = global.module, _exports = global.exports;
8383
global.module = undefined;
8484
global.exports = undefined;
85+
global.__dirname = file.substring(0, file.lastIndexOf('/'));
86+
global.__filename = file;
8587
vm.runInThisContext(fs.readFileSync(file), file);
8688
global.exports = _exports;
8789
global.module = _module;

0 commit comments

Comments
 (0)