From e09eaf05393a5eb67ff7060f0cab45ea8803a48b Mon Sep 17 00:00:00 2001 From: Keifer Gu Date: Sun, 30 Apr 2017 18:23:47 +0800 Subject: [PATCH] Fix the issue #6 Use `eval` to avoid the checking when build. --- src/qrcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qrcode.js b/src/qrcode.js index 348bbb9..a2a438c 100644 --- a/src/qrcode.js +++ b/src/qrcode.js @@ -54,7 +54,7 @@ module.exports = function(Canvas){ return instance instanceof Canvas; } var s = require; //trick browserify into not including canvas - if(!Canvas) Canvas = s('canvas'); + if(!Canvas) Canvas = eval("s('canvas')"); Image = Canvas.Image; }