mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-26 22:20:56 +00:00
Make legacy build less frankenstein
This commit is contained in:
parent
c1b9c31e04
commit
be3043240f
@ -21,18 +21,9 @@ build_js()
|
|||||||
|
|
||||||
# Wrap webkit output into an non-breaking form.
|
# Wrap webkit output into an non-breaking form.
|
||||||
# In an upcoming verion these will be replaced with standard webpack umd
|
# In an upcoming verion these will be replaced with standard webpack umd
|
||||||
cat ./tools/template/beautify.begin.js > ./js/lib/beautify.js
|
sed '/GENERATED_BUILD_OUTPUT/ r ./build/legacy/legacy_beautify_js.js' <./tools/template/beautify.wrapper.js >./js/lib/beautify.js || exit 1
|
||||||
cat ./dist/legacy_beautify_js.js >> ./js/lib/beautify.js
|
sed '/GENERATED_BUILD_OUTPUT/ r ./build/legacy/legacy_beautify_css.js' <./tools/template/beautify-css.wrapper.js >./js/lib/beautify-css.js || exit 1
|
||||||
cat ./tools/template/beautify.end.js >> ./js/lib/beautify.js
|
sed '/GENERATED_BUILD_OUTPUT/ r ./build/legacy/legacy_beautify_html.js' <./tools/template/beautify-html.wrapper.js >./js/lib/beautify-html.js || exit 1
|
||||||
|
|
||||||
cat ./tools/template/beautify-css.begin.js > ./js/lib/beautify-css.js
|
|
||||||
cat ./dist/legacy_beautify_css.js >> ./js/lib/beautify-css.js
|
|
||||||
cat ./tools/template/beautify-css.end.js >> ./js/lib/beautify-css.js
|
|
||||||
|
|
||||||
cat ./tools/template/beautify-html.begin.js > ./js/lib/beautify-html.js
|
|
||||||
cat ./dist/legacy_beautify_html.js >> ./js/lib/beautify-html.js
|
|
||||||
cat ./tools/template/beautify-html.end.js >> ./js/lib/beautify-html.js
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_beautify()
|
build_beautify()
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
|
|
||||||
var css_beautify = legacy_beautify_css;
|
|
||||||
/* Footer */
|
|
||||||
if (typeof define === "function" && define.amd) {
|
|
||||||
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
|
||||||
define([], function() {
|
|
||||||
return {
|
|
||||||
css_beautify: css_beautify
|
|
||||||
};
|
|
||||||
});
|
|
||||||
} else if (typeof exports !== "undefined") {
|
|
||||||
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
|
||||||
// and you will be able to `var html_beautify = require("beautify").html_beautify`.
|
|
||||||
exports.css_beautify = css_beautify;
|
|
||||||
} else if (typeof window !== "undefined") {
|
|
||||||
// If we're running a web page and don't have either of the above, add our one global
|
|
||||||
window.css_beautify = css_beautify;
|
|
||||||
} else if (typeof global !== "undefined") {
|
|
||||||
// If we don't even have window, try global.
|
|
||||||
global.css_beautify = css_beautify;
|
|
||||||
}
|
|
||||||
|
|
||||||
}());
|
|
@ -63,3 +63,28 @@
|
|||||||
// http://www.w3.org/TR/css3-syntax/
|
// http://www.w3.org/TR/css3-syntax/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
/* GENERATED_BUILD_OUTPUT */
|
||||||
|
|
||||||
|
var css_beautify = legacy_beautify_css;
|
||||||
|
/* Footer */
|
||||||
|
if (typeof define === "function" && define.amd) {
|
||||||
|
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
||||||
|
define([], function() {
|
||||||
|
return {
|
||||||
|
css_beautify: css_beautify
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} else if (typeof exports !== "undefined") {
|
||||||
|
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
||||||
|
// and you will be able to `var html_beautify = require("beautify").html_beautify`.
|
||||||
|
exports.css_beautify = css_beautify;
|
||||||
|
} else if (typeof window !== "undefined") {
|
||||||
|
// If we're running a web page and don't have either of the above, add our one global
|
||||||
|
window.css_beautify = css_beautify;
|
||||||
|
} else if (typeof global !== "undefined") {
|
||||||
|
// If we don't even have window, try global.
|
||||||
|
global.css_beautify = css_beautify;
|
||||||
|
}
|
||||||
|
|
||||||
|
}());
|
@ -1,37 +0,0 @@
|
|||||||
|
|
||||||
var style_html = legacy_beautify_html;
|
|
||||||
/* Footer */
|
|
||||||
if (typeof define === "function" && define.amd) {
|
|
||||||
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
|
||||||
define(["require", "./beautify", "./beautify-css"], function(requireamd) {
|
|
||||||
var js_beautify = requireamd("./beautify");
|
|
||||||
var css_beautify = requireamd("./beautify-css");
|
|
||||||
|
|
||||||
return {
|
|
||||||
html_beautify: function(html_source, options) {
|
|
||||||
return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
} else if (typeof exports !== "undefined") {
|
|
||||||
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
|
||||||
// and you will be able to `var html_beautify = require("beautify").html_beautify`.
|
|
||||||
var js_beautify = require('./beautify.js');
|
|
||||||
var css_beautify = require('./beautify-css.js');
|
|
||||||
|
|
||||||
exports.html_beautify = function(html_source, options) {
|
|
||||||
return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
|
|
||||||
};
|
|
||||||
} else if (typeof window !== "undefined") {
|
|
||||||
// If we're running a web page and don't have either of the above, add our one global
|
|
||||||
window.html_beautify = function(html_source, options) {
|
|
||||||
return style_html(html_source, options, window.js_beautify, window.css_beautify);
|
|
||||||
};
|
|
||||||
} else if (typeof global !== "undefined") {
|
|
||||||
// If we don't even have window, try global.
|
|
||||||
global.html_beautify = function(html_source, options) {
|
|
||||||
return style_html(html_source, options, global.js_beautify, global.css_beautify);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}());
|
|
@ -73,3 +73,42 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
/* GENERATED_BUILD_OUTPUT */
|
||||||
|
|
||||||
|
var style_html = legacy_beautify_html;
|
||||||
|
/* Footer */
|
||||||
|
if (typeof define === "function" && define.amd) {
|
||||||
|
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
||||||
|
define(["require", "./beautify", "./beautify-css"], function(requireamd) {
|
||||||
|
var js_beautify = requireamd("./beautify");
|
||||||
|
var css_beautify = requireamd("./beautify-css");
|
||||||
|
|
||||||
|
return {
|
||||||
|
html_beautify: function(html_source, options) {
|
||||||
|
return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} else if (typeof exports !== "undefined") {
|
||||||
|
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
||||||
|
// and you will be able to `var html_beautify = require("beautify").html_beautify`.
|
||||||
|
var js_beautify = require('./beautify.js');
|
||||||
|
var css_beautify = require('./beautify-css.js');
|
||||||
|
|
||||||
|
exports.html_beautify = function(html_source, options) {
|
||||||
|
return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
|
||||||
|
};
|
||||||
|
} else if (typeof window !== "undefined") {
|
||||||
|
// If we're running a web page and don't have either of the above, add our one global
|
||||||
|
window.html_beautify = function(html_source, options) {
|
||||||
|
return style_html(html_source, options, window.js_beautify, window.css_beautify);
|
||||||
|
};
|
||||||
|
} else if (typeof global !== "undefined") {
|
||||||
|
// If we don't even have window, try global.
|
||||||
|
global.html_beautify = function(html_source, options) {
|
||||||
|
return style_html(html_source, options, global.js_beautify, global.css_beautify);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}());
|
@ -1,21 +0,0 @@
|
|||||||
|
|
||||||
var js_beautify = legacy_beautify_js;
|
|
||||||
/* Footer */
|
|
||||||
if (typeof define === "function" && define.amd) {
|
|
||||||
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
|
||||||
define([], function() {
|
|
||||||
return { js_beautify: js_beautify };
|
|
||||||
});
|
|
||||||
} else if (typeof exports !== "undefined") {
|
|
||||||
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
|
||||||
// and you will be able to `var js_beautify = require("beautify").js_beautify`.
|
|
||||||
exports.js_beautify = js_beautify;
|
|
||||||
} else if (typeof window !== "undefined") {
|
|
||||||
// If we're running a web page and don't have either of the above, add our one global
|
|
||||||
window.js_beautify = js_beautify;
|
|
||||||
} else if (typeof global !== "undefined") {
|
|
||||||
// If we don't even have window, try global.
|
|
||||||
global.js_beautify = js_beautify;
|
|
||||||
}
|
|
||||||
|
|
||||||
}());
|
|
@ -86,3 +86,27 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
/* GENERATED_BUILD_OUTPUT */
|
||||||
|
|
||||||
|
var js_beautify = legacy_beautify_js;
|
||||||
|
/* Footer */
|
||||||
|
if (typeof define === "function" && define.amd) {
|
||||||
|
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
|
||||||
|
define([], function() {
|
||||||
|
return { js_beautify: js_beautify };
|
||||||
|
});
|
||||||
|
} else if (typeof exports !== "undefined") {
|
||||||
|
// Add support for CommonJS. Just put this file somewhere on your require.paths
|
||||||
|
// and you will be able to `var js_beautify = require("beautify").js_beautify`.
|
||||||
|
exports.js_beautify = js_beautify;
|
||||||
|
} else if (typeof window !== "undefined") {
|
||||||
|
// If we're running a web page and don't have either of the above, add our one global
|
||||||
|
window.js_beautify = js_beautify;
|
||||||
|
} else if (typeof global !== "undefined") {
|
||||||
|
// If we don't even have window, try global.
|
||||||
|
global.js_beautify = js_beautify;
|
||||||
|
}
|
||||||
|
|
||||||
|
}());
|
||||||
|
|
@ -13,7 +13,7 @@ var legacy = {
|
|||||||
output: {
|
output: {
|
||||||
library: 'legacy_[name]',
|
library: 'legacy_[name]',
|
||||||
filename: 'legacy_[name].js',
|
filename: 'legacy_[name].js',
|
||||||
path: path.resolve(__dirname, 'dist')
|
path: path.resolve(__dirname, 'build/legacy')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user