From 3c5e1c06ed87e73d9f5dbdc26bdd72128e6a3e12 Mon Sep 17 00:00:00 2001 From: Severin Date: Fri, 21 Apr 2017 08:01:51 +0200 Subject: [PATCH] #155 process is undefined in webpack process is a global nodejs variable that is not defined in the browser by default. So webpack doesn't know about it. Of course there are ways to define the process variable with webpack but that is not the default behavior and needs a plugin (DefinePlugin) or other workaround. I've tested this change locally with an angular/ionic app and it works great. --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 397e863..4520d12 100644 --- a/index.js +++ b/index.js @@ -5,11 +5,15 @@ globals.forEach(function(g) { if (g in global) globalValues[g] = global[g]; }); -require(process.env['LATER_COV'] ? "./later-cov" : "./later"); +if (process && process.env['LATER_COV']) { + require("./later.cov"); +} else { + require("./later"); +} module.exports = later; globals.forEach(function(g) { if (g in globalValues) global[g] = globalValues[g]; else delete global[g]; -}); \ No newline at end of file +});