Browserify - How to call function bundled in a file generated through browserify in browser

前端 未结 11 2160
-上瘾入骨i
-上瘾入骨i 2020-11-29 17:18

I am new to nodejs and browserify. I started with this link .

I have file main.js which contains this code

var unique = require(\'uniq\');

var data          


        
11条回答
  •  醉梦人生
    2020-11-29 18:04

    For debugging purposes I added this line to my code.js:

    window.e = function(data) {eval(data);};
    

    Then I could run anything even outside the bundle.

    e("anything();");
    

提交回复
热议问题