diff --git a/Gruntfile.js b/Gruntfile.js index a9fccaa58264..8a34c4e63f1d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -147,36 +147,6 @@ module.exports = function (grunt) { }, // CSS build configuration - cssmin: { - options: { - sourceMap: true, - // sourceMapInlineSources: true, - advanced: false - }, - core: { - files: [ - { - expand: true, - cwd: 'dist/css', - src: ['*.css', '!*.min.css'], - dest: 'dist/css', - ext: '.min.css' - } - ] - }, - docs: { - files: [ - { - expand: true, - cwd: 'docs/assets/css', - src: ['*.css', '!*.min.css'], - dest: 'docs/assets/css', - ext: '.min.css' - } - ] - } - }, - copy: { docs: { expand: true, @@ -260,6 +230,12 @@ module.exports = function (grunt) { }, exec: { + 'clean-css': { + command: 'npm run clean-css' + }, + 'clean-css-docs': { + command: 'npm run clean-css-docs' + }, postcss: { command: 'npm run postcss' }, @@ -371,7 +347,7 @@ module.exports = function (grunt) { // grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']); grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']); - grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'cssmin:core', 'cssmin:docs']); + grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'exec:clean-css', 'exec:clean-css-docs']); // Full distribution task. grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']); @@ -380,7 +356,7 @@ module.exports = function (grunt) { grunt.registerTask('default', ['clean:dist', 'test']); // Docs task. - grunt.registerTask('docs-css', ['cssmin:docs', 'exec:postcss-docs']); + grunt.registerTask('docs-css', ['exec:clean-css-docs', 'exec:postcss-docs']); grunt.registerTask('lint-docs-css', ['exec:scss-lint-docs']); grunt.registerTask('docs-js', ['uglify:docsJs']); grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']); diff --git a/grunt/npm-shrinkwrap.json b/grunt/npm-shrinkwrap.json index beef37ad454d..b3988531fd8e 100644 --- a/grunt/npm-shrinkwrap.json +++ b/grunt/npm-shrinkwrap.json @@ -55,9 +55,9 @@ "dev": true }, "ajv-keywords": { - "version": "1.2.0", + "version": "1.3.0", "from": "ajv-keywords@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.3.0.tgz", "dev": true }, "align-text": { @@ -570,18 +570,10 @@ "optional": true }, "bl": { - "version": "1.1.2", + "version": "1.2.0", "from": "bl@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", - "dev": true, - "dependencies": { - "readable-stream": { - "version": "2.0.6", - "from": "readable-stream@>=2.0.5 <2.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "dev": true - } - } + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.0.tgz", + "dev": true }, "block-stream": { "version": "0.0.9", @@ -590,9 +582,9 @@ "dev": true }, "bluebird": { - "version": "3.4.6", + "version": "3.4.7", "from": "bluebird@>=3.0.6 <4.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.6.tgz", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", "dev": true }, "body-parser": { @@ -759,7 +751,7 @@ }, "clean-css": { "version": "3.4.23", - "from": "clean-css@>=3.4.2 <3.5.0", + "from": "clean-css@>=3.4.23 <4.0.0", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.23.tgz", "dev": true, "dependencies": { @@ -1777,12 +1769,6 @@ "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", "dev": true }, - "grunt-contrib-cssmin": { - "version": "1.0.2", - "from": "grunt-contrib-cssmin@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-1.0.2.tgz", - "dev": true - }, "grunt-contrib-qunit": { "version": "1.2.0", "from": "grunt-contrib-qunit@>=1.2.0 <2.0.0", @@ -2518,9 +2504,9 @@ "dev": true }, "jsonpointer": { - "version": "4.0.0", + "version": "4.0.1", "from": "jsonpointer@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", "dev": true }, "jsprim": { @@ -2773,9 +2759,9 @@ "dev": true }, "nan": { - "version": "2.4.0", + "version": "2.5.0", "from": "nan@>=2.3.2 <3.0.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.4.0.tgz", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.5.0.tgz", "dev": true }, "natural-compare": { @@ -3682,9 +3668,9 @@ "dev": true }, "source-map-support": { - "version": "0.4.6", + "version": "0.4.7", "from": "source-map-support@>=0.4.2 <0.5.0", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.6.tgz", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.7.tgz", "dev": true }, "spdx-correct": { diff --git a/package.json b/package.json index 9ca76f663b17..f01c27ebac80 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ ], "scripts": { "change-version": "node grunt/change-version.js", + "clean-css": "cleancss --skip-advanced --source-map --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --skip-advanced --source-map --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css", + "clean-css-docs": "cleancss --skip-advanced --source-map --output docs/assets/css/docs.min.css docs/assets/css/docs.min.css", "eslint": "eslint --ignore-path .eslintignore js", "jscs": "jscs --config=js/.jscsrc js/src js/tests/unit docs/assets/js/src grunt Gruntfile.js docs/assets/js/ie-emulation-modes-warning.js docs/assets/js/ie10-viewport-bug-workaround.js", "htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/", @@ -48,6 +50,7 @@ "babel-eslint": "^7.0.0", "babel-plugin-transform-es2015-modules-strip": "^0.1.0", "babel-preset-es2015": "^6.16.0", + "clean-css": "^3.4.23", "eslint": "^3.7.1", "grunt": "^1.0.1", "grunt-babel": "^6.0.0", @@ -57,7 +60,6 @@ "grunt-contrib-concat": "^1.0.1", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-cssmin": "^1.0.2", "grunt-contrib-qunit": "^1.2.0", "grunt-contrib-sass": "^1.0.0", "grunt-contrib-uglify": "^2.0.0",