@eleith: make require.js optimizable

@eleith:
when you passin the require module through the define function, i'm
unable to get r.js (require's node module for optimizing scripts) to
properly optimize beautify-html. my guess is that it does not read that
beautify-html has two dependencies.

however, when using define's first parameter option which is to pass an
array of dependency, r.js properly picks up the dependencies and bundles
them in the optimization process.
This commit is contained in:
Einar Lielmanis 2013-07-03 20:52:14 +03:00
parent 4d9c10797f
commit 513dfdb5f7

View File

@ -706,11 +706,8 @@
if (typeof define === "function") {
// Add support for require.js
define(function(require, exports, module) {
var js_beautify = require('./beautify.js').js_beautify;
var css_beautify = require('./beautify-css.js').css_beautify;
exports.html_beautify = function(html_source, options) {
define(["./beautify.js", "./beautify-css.js"], function(js_beautify, css_beautify) {
return function(html_source, options) {
return style_html(html_source, options, js_beautify, css_beautify);
};
});