mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01: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:
parent
ee2df11e93
commit
3f90763995
@ -276,7 +276,24 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
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')
|
||||
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' +
|
||||
' */\n'
|
||||
|
||||
generateZip(generateCSS(preamble), generateJavascript(preamble), generateFonts(), configJson, function (blob) {
|
||||
generateZip(generateCSS(preamble), generateJS(preamble), generateFonts(), configJson, function (blob) {
|
||||
$compileBtn.removeAttr('disabled')
|
||||
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
Loading…
x
Reference in New Issue
Block a user