1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Move clean-css to npm scripts.

This commit is contained in:
Bardi Harborow 2016-12-23 15:02:54 +11:00
parent 800cfa24ad
commit 6993595341
3 changed files with 25 additions and 61 deletions

View file

@ -147,36 +147,6 @@ module.exports = function (grunt) {
}, },
// CSS build configuration // 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: { copy: {
docs: { docs: {
expand: true, expand: true,
@ -260,6 +230,12 @@ module.exports = function (grunt) {
}, },
exec: { exec: {
'clean-css': {
command: 'npm run clean-css'
},
'clean-css-docs': {
command: 'npm run clean-css-docs'
},
postcss: { postcss: {
command: 'npm run 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('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. // Full distribution task.
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']); grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']);
@ -380,7 +356,7 @@ module.exports = function (grunt) {
grunt.registerTask('default', ['clean:dist', 'test']); grunt.registerTask('default', ['clean:dist', 'test']);
// Docs task. // 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('lint-docs-css', ['exec:scss-lint-docs']);
grunt.registerTask('docs-js', ['uglify:docsJs']); grunt.registerTask('docs-js', ['uglify:docsJs']);
grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']); grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']);

View file

@ -55,9 +55,9 @@
"dev": true "dev": true
}, },
"ajv-keywords": { "ajv-keywords": {
"version": "1.2.0", "version": "1.3.0",
"from": "ajv-keywords@>=1.0.0 <2.0.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 "dev": true
}, },
"align-text": { "align-text": {
@ -570,18 +570,10 @@
"optional": true "optional": true
}, },
"bl": { "bl": {
"version": "1.1.2", "version": "1.2.0",
"from": "bl@>=1.0.0 <2.0.0", "from": "bl@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.0.tgz",
"dev": true, "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
}
}
}, },
"block-stream": { "block-stream": {
"version": "0.0.9", "version": "0.0.9",
@ -590,9 +582,9 @@
"dev": true "dev": true
}, },
"bluebird": { "bluebird": {
"version": "3.4.6", "version": "3.4.7",
"from": "bluebird@>=3.0.6 <4.0.0", "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 "dev": true
}, },
"body-parser": { "body-parser": {
@ -759,7 +751,7 @@
}, },
"clean-css": { "clean-css": {
"version": "3.4.23", "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", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.23.tgz",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
@ -1777,12 +1769,6 @@
"resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz",
"dev": true "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": { "grunt-contrib-qunit": {
"version": "1.2.0", "version": "1.2.0",
"from": "grunt-contrib-qunit@>=1.2.0 <2.0.0", "from": "grunt-contrib-qunit@>=1.2.0 <2.0.0",
@ -2518,9 +2504,9 @@
"dev": true "dev": true
}, },
"jsonpointer": { "jsonpointer": {
"version": "4.0.0", "version": "4.0.1",
"from": "jsonpointer@>=4.0.0 <5.0.0", "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 "dev": true
}, },
"jsprim": { "jsprim": {
@ -2773,9 +2759,9 @@
"dev": true "dev": true
}, },
"nan": { "nan": {
"version": "2.4.0", "version": "2.5.0",
"from": "nan@>=2.3.2 <3.0.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 "dev": true
}, },
"natural-compare": { "natural-compare": {
@ -3682,9 +3668,9 @@
"dev": true "dev": true
}, },
"source-map-support": { "source-map-support": {
"version": "0.4.6", "version": "0.4.7",
"from": "source-map-support@>=0.4.2 <0.5.0", "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 "dev": true
}, },
"spdx-correct": { "spdx-correct": {

View file

@ -18,6 +18,8 @@
], ],
"scripts": { "scripts": {
"change-version": "node grunt/change-version.js", "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", "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", "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/", "htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/",
@ -48,6 +50,7 @@
"babel-eslint": "^7.0.0", "babel-eslint": "^7.0.0",
"babel-plugin-transform-es2015-modules-strip": "^0.1.0", "babel-plugin-transform-es2015-modules-strip": "^0.1.0",
"babel-preset-es2015": "^6.16.0", "babel-preset-es2015": "^6.16.0",
"clean-css": "^3.4.23",
"eslint": "^3.7.1", "eslint": "^3.7.1",
"grunt": "^1.0.1", "grunt": "^1.0.1",
"grunt-babel": "^6.0.0", "grunt-babel": "^6.0.0",
@ -57,7 +60,6 @@
"grunt-contrib-concat": "^1.0.1", "grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^1.0.2", "grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "^1.0.0", "grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^1.0.2",
"grunt-contrib-qunit": "^1.2.0", "grunt-contrib-qunit": "^1.2.0",
"grunt-contrib-sass": "^1.0.0", "grunt-contrib-sass": "^1.0.0",
"grunt-contrib-uglify": "^2.0.0", "grunt-contrib-uglify": "^2.0.0",