mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-11 08:04:59 +02:00
Customizer: switch to UglifyJS2 (v2.4.13).
The uglify build is generated with `uglifyjs --self -o uglify.min.js`.
This commit is contained in:
@@ -276,7 +276,24 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateJavascript(preamble) {
|
function uglify(js) {
|
||||||
|
var ast = UglifyJS.parse(js)
|
||||||
|
ast.figure_out_scope()
|
||||||
|
|
||||||
|
var compressor = UglifyJS.Compressor()
|
||||||
|
var compressedAst = ast.transform(compressor)
|
||||||
|
|
||||||
|
compressedAst.figure_out_scope()
|
||||||
|
compressedAst.compute_char_frequency()
|
||||||
|
compressedAst.mangle_names()
|
||||||
|
|
||||||
|
var stream = UglifyJS.OutputStream()
|
||||||
|
compressedAst.print(stream)
|
||||||
|
|
||||||
|
return stream.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateJS(preamble) {
|
||||||
var $checked = $('#plugin-section input:checked')
|
var $checked = $('#plugin-section input:checked')
|
||||||
if (!$checked.length) return false
|
if (!$checked.length) return false
|
||||||
|
|
||||||
@@ -351,7 +368,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
|||||||
' * Config saved to config.json and ' + gistUrl + '\n' +
|
' * Config saved to config.json and ' + gistUrl + '\n' +
|
||||||
' */\n'
|
' */\n'
|
||||||
|
|
||||||
generateZip(generateCSS(preamble), generateJavascript(preamble), generateFonts(), configJson, function (blob) {
|
generateZip(generateCSS(preamble), generateJS(preamble), generateFonts(), configJson, function (blob) {
|
||||||
$compileBtn.removeAttr('disabled')
|
$compileBtn.removeAttr('disabled')
|
||||||
saveAs(blob, 'bootstrap.zip')
|
saveAs(blob, 'bootstrap.zip')
|
||||||
})
|
})
|
||||||
|
19
docs/assets/js/_vendor/uglify.min.js
vendored
19
docs/assets/js/_vendor/uglify.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user