From ee60fb7af6647670ec0c48ac0424361d61e99039 Mon Sep 17 00:00:00 2001 From: Ryan Tsao Date: Mon, 11 Dec 2017 10:30:20 -1000 Subject: [PATCH] Build-time __dirname in test builds --- build/compiler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/compiler.js b/build/compiler.js index c422c936..1ce54877 100644 --- a/build/compiler.js +++ b/build/compiler.js @@ -210,7 +210,8 @@ function getConfig({target, env, dir, watch, cover}) { setImmediate: false, // Mocking __filename and __dirname is probably harmless, but for consistency let's keep it off for now. __filename: false, - __dirname: false, + // Tape also requires __dirname, remove once we don't use tape anymore + __dirname: env === 'test' && target === 'web' ? true : false, /** * Tape requires `fs` to be defined */