Browserify 不 link 我的功能

Browserify doesn't link to my function

我正在尝试使用 Browserify 将我的项目重构为模块。在我的主文件中,我有这样的东西:

var $ = require('jquery');
var data = require('./cv-data.js');
var menu = require('./components/menuScript.js');
menu();

jquery 库和数据已正确导入,但是当我尝试使用我的菜单函数时,我收到一条错误消息 Uncaught TypeError: menu is not a function。我的菜单脚本如下所示:

var menu = function() {
  console.log('hello'); // not really but lets say it looks like this.
}
module.export = menu;

我尝试了很多不同的方法,但 none 似乎有效。

var menu = {
  init: function(){
    console.log('hello');
  }
}
module.export = menu;

然后:

var menu = require('./components/menuScript.js');
menu.init();

我确定我漏掉了一些小东西,但看不到它!

exports复数

module.exports = menu;
// ----------^