0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Merge branch 'minify-assets' of https://github.com/XhmikosR/bootstrap into XhmikosR-minify-assets

Conflicts:
	package.json
This commit is contained in:
Mark Otto 2014-01-11 14:48:04 -08:00
commit e68d3b961e
9 changed files with 65 additions and 20 deletions

View File

@ -26,7 +26,13 @@ module.exports = function (grunt) {
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under <%= _.pluck(pkg.licenses, "type") %> (<%= _.pluck(pkg.licenses, "url") %>)\n' +
' */\n',
jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',
bannerDocs: '/*!\n' +
' * Bootstrap Docs (<%= pkg.homepage %>)\n' +
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under the Creative Commons Attribution 3.0 Unported License. For\n' +
' * details, see http://creativecommons.org/licenses/by/3.0/.\n' +
' */\n',
jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'Bootstrap requires jQuery\') }\n\n',
// Task configuration.
clean: {
@ -113,7 +119,7 @@ module.exports = function (grunt) {
uglify: {
bootstrap: {
options: {
banner: '<%= banner %>\n',
banner: '<%= banner %>',
report: 'min'
},
src: ['<%= concat.bootstrap.dest %>'],
@ -121,12 +127,7 @@ module.exports = function (grunt) {
},
customize: {
options: {
banner: '/*!\n' +
' * Bootstrap Docs (<%= pkg.homepage %>)\n' +
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under the Creative Commons Attribution 3.0 Unported License. For\n' +
' * details, see http://creativecommons.org/licenses/by/3.0/.\n' +
' */\n',
banner: '<%= bannerDocs %>',
report: 'min'
},
src: [
@ -134,9 +135,21 @@ module.exports = function (grunt) {
'docs/assets/js/jszip.js',
'docs/assets/js/uglify.js',
'docs/assets/js/filesaver.js',
'docs/assets/js/raw-files.js',
'docs/assets/js/customizer.js'
],
dest: 'docs/assets/js/customize.min.js'
},
docsJs: {
options: {
banner: '<%= bannerDocs %>',
report: 'min'
},
src: [
'docs/assets/js/holder.js',
'docs/assets/js/application.js'
],
dest: 'docs/assets/js/docs.min.js'
}
},
@ -177,6 +190,23 @@ module.exports = function (grunt) {
}
},
cssmin: {
compress: {
options: {
banner: '<%= bannerDocs %>',
keepSpecialComments: '*',
noAdvanced: true, // turn advanced optimizations off until it's fixed in clean-css
report: 'min',
selectorsMergeMode: 'ie8'
},
src: [
'docs/assets/css/docs.css',
'docs/assets/css/pygments-manni.css'
],
dest: 'docs/assets/css/pack.min.css'
}
},
usebanner: {
dist: {
options: {
@ -345,7 +375,7 @@ module.exports = function (grunt) {
grunt.registerTask('dist-js', ['concat', 'uglify']);
// CSS distribution task.
grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']);
grunt.registerTask('dist-css', ['less', 'cssmin', 'csscomb', 'usebanner']);
// Docs distribution task.
grunt.registerTask('dist-docs', ['copy:docs']);

View File

@ -4,7 +4,7 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }
if (typeof jQuery === 'undefined') { throw new Error('Bootstrap requires jQuery') }
/* ========================================================================
* Bootstrap: transition.js v3.0.3

File diff suppressed because one or more lines are too long

View File

@ -3,12 +3,8 @@
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="{{ site.baseurl }}dist/js/bootstrap.min.js"></script>
<script src="{{ site.baseurl }}assets/js/holder.js"></script>
<script src="{{ site.baseurl }}assets/js/application.js"></script>
<script src="{{ site.baseurl }}assets/js/docs.min.js"></script>
{% if page.slug == "customize" %}
<script src="{{ site.baseurl }}assets/js/raw-files.js"></script>
<script src="{{ site.baseurl }}assets/js/customize.min.js"></script>
{% endif %}

View File

@ -17,8 +17,7 @@
<link href="{{ site.baseurl }}dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Documentation extras -->
<link href="{{ site.baseurl }}assets/css/docs.css" rel="stylesheet">
<link href="{{ site.baseurl }}assets/css/pygments-manni.css" rel="stylesheet">
<link href="{{ site.baseurl }}assets/css/pack.min.css" rel="stylesheet">
<!--[if lt IE 9]><script src="{{ site.baseurl }}assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

13
docs/assets/css/pack.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
docs/assets/js/docs.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -33,6 +33,7 @@
"grunt-contrib-connect": "~0.6.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-csslint": "~0.2.0",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-jade": "~0.9.1",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-less": "~0.9.0",