Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
definer('a', function() { return 'a'; });
definer('b', function() { return 'b'; });
definer('c', function(a, b) { return a + b + 'c'; });
(function(global, undefined) {
var a = (function () { return 'a'; }).call(global),
b = (function () { return 'b'; }).call(global),
c = (function (a, b) { return a + b + 'c'; }).call(global, a, b);
})(this);
module.exports = function() { return 'a'; };
module.exports = function() { return 'b'; };
module.exports = function() { return require('./a') + require('./b') + 'c'; }
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = function() { return 'a'; };
},{}],2:[function(require,module,exports){
module.exports = function() { return 'b'; };
},{}],"XGSqeA":[function(require,module,exports){
module.exports = function() { return require('./a') + require('./b') + 'c'; }
},{"./a":1,"./b":2}],"./c.js":[function(require,module,exports){
module.exports=require('XGSqeA');
},{}]},{},[])
make modulename?make modulename? Спасибо, я лучше browserify/webmake попользуюсь.make module1 module2 ... moduleN.var assign = require('lodash/compat/objects/assign') если нужна всего одна функция.require() вызовы)(function(global, undefined) {
var a = (function () { return 'a'; }).call(global),
b = (function () { return 'b'; }).call(global),
c = (function (a, b) { return a + b + 'c'; }).call(global, a, b);
})(this);
Самая простая модульная система
Definer.js — простая модульная система