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

前端 未结 11 2168
-上瘾入骨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

    window.LogData =function(data){
       return unique(data);
    };
    

    Call the function simply by LogData(data)

    This is just a slight modification to thejh's answer but important one

提交回复
热议问题