function fn1() { console.log("我是fn1()") } function fn2() { console.log("我是fn2()") }
require.config({ shim: { "funs": { init: function() { return { fn1: fn1, fn2: fn2 } } } } });
requirejs(["funs"], function(o) { o.fn1(); o.fn2(); });