mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-20 20:00:36 +03:00
Merge branch 'master' into pr/11776
Conflicts: package.json
This commit is contained in:
+78
-49
@@ -1,7 +1,7 @@
|
||||
/* jshint node: true */
|
||||
|
||||
module.exports = function (grunt) {
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
// Force use of Unix newlines
|
||||
grunt.util.linefeed = '\n';
|
||||
@@ -39,6 +39,9 @@ module.exports = function (grunt) {
|
||||
},
|
||||
test: {
|
||||
src: ['js/tests/unit/*.js']
|
||||
},
|
||||
assets: {
|
||||
src: ['docs-assets/js/application.js', 'docs-assets/js/customizer.js']
|
||||
}
|
||||
},
|
||||
|
||||
@@ -57,6 +60,13 @@ module.exports = function (grunt) {
|
||||
}
|
||||
},
|
||||
|
||||
csslint: {
|
||||
options: {
|
||||
csslintrc: '.csslintrc'
|
||||
},
|
||||
src: ['dist/css/bootstrap.css', 'dist/css/bootstrap-theme.css']
|
||||
},
|
||||
|
||||
concat: {
|
||||
options: {
|
||||
banner: '<%= banner %><%= jqueryCheck %>',
|
||||
@@ -102,39 +112,61 @@ module.exports = function (grunt) {
|
||||
}
|
||||
},
|
||||
|
||||
recess: {
|
||||
options: {
|
||||
compile: true,
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
bootstrap: {
|
||||
src: ['less/bootstrap.less'],
|
||||
dest: 'dist/css/<%= pkg.name %>.css'
|
||||
},
|
||||
min: {
|
||||
less: {
|
||||
compile: {
|
||||
options: {
|
||||
compress: true
|
||||
strictMath: true
|
||||
},
|
||||
src: ['less/bootstrap.less'],
|
||||
dest: 'dist/css/<%= pkg.name %>.min.css'
|
||||
files: {
|
||||
'dist/css/<%= pkg.name %>.css': 'less/bootstrap.less',
|
||||
'dist/css/<%= pkg.name %>-theme.css': 'less/theme.less'
|
||||
}
|
||||
},
|
||||
theme: {
|
||||
src: ['less/theme.less'],
|
||||
dest: 'dist/css/<%= pkg.name %>-theme.css'
|
||||
},
|
||||
theme_min: {
|
||||
minify: {
|
||||
options: {
|
||||
compress: true
|
||||
cleancss: true,
|
||||
report: 'min'
|
||||
},
|
||||
src: ['less/theme.less'],
|
||||
dest: 'dist/css/<%= pkg.name %>-theme.min.css'
|
||||
files: {
|
||||
'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css',
|
||||
'dist/css/<%= pkg.name %>-theme.min.css': 'dist/css/<%= pkg.name %>-theme.css'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
usebanner: {
|
||||
dist: {
|
||||
options: {
|
||||
position: 'top',
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
files: {
|
||||
src: [
|
||||
'dist/css/<%= pkg.name %>.css',
|
||||
'dist/css/<%= pkg.name %>.min.css',
|
||||
'dist/css/<%= pkg.name %>-theme.css',
|
||||
'dist/css/<%= pkg.name %>-theme.min.css',
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
csscomb: {
|
||||
sort: {
|
||||
options: {
|
||||
sortOrder: '.csscomb.json'
|
||||
},
|
||||
files: {
|
||||
'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css'],
|
||||
'dist/css/<%= pkg.name %>-theme.css': ['dist/css/<%= pkg.name %>-theme.css'],
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
copy: {
|
||||
fonts: {
|
||||
expand: true,
|
||||
src: ["fonts/*"],
|
||||
src: ['fonts/*'],
|
||||
dest: 'dist/'
|
||||
}
|
||||
},
|
||||
@@ -163,12 +195,12 @@ module.exports = function (grunt) {
|
||||
options: {
|
||||
reset: true,
|
||||
relaxerror: [
|
||||
"Bad value X-UA-Compatible for attribute http-equiv on element meta.",
|
||||
"Element img is missing required attribute src."
|
||||
'Bad value X-UA-Compatible for attribute http-equiv on element meta.',
|
||||
'Element img is missing required attribute src.'
|
||||
]
|
||||
},
|
||||
files: {
|
||||
src: ["_gh_pages/**/*.html"]
|
||||
src: ['_gh_pages/**/*.html']
|
||||
}
|
||||
},
|
||||
|
||||
@@ -181,9 +213,9 @@ module.exports = function (grunt) {
|
||||
files: '<%= jshint.test.src %>',
|
||||
tasks: ['jshint:test', 'qunit']
|
||||
},
|
||||
recess: {
|
||||
less: {
|
||||
files: 'less/*.less',
|
||||
tasks: ['recess']
|
||||
tasks: ['less']
|
||||
}
|
||||
},
|
||||
|
||||
@@ -208,13 +240,13 @@ module.exports = function (grunt) {
|
||||
// See https://saucelabs.com/docs/platforms/webdriver
|
||||
{
|
||||
browserName: 'safari',
|
||||
version: '6',
|
||||
platform: 'OS X 10.8'
|
||||
version: '7',
|
||||
platform: 'OS X 10.9'
|
||||
},
|
||||
{
|
||||
browserName: 'chrome',
|
||||
version: '28',
|
||||
platform: 'OS X 10.6'
|
||||
version: '31',
|
||||
platform: 'OS X 10.9'
|
||||
},
|
||||
/* FIXME: currently fails 1 tooltip test
|
||||
{
|
||||
@@ -295,28 +327,25 @@ module.exports = function (grunt) {
|
||||
|
||||
|
||||
// These plugins provide necessary tasks.
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-html-validation');
|
||||
grunt.loadNpmTasks('grunt-jekyll');
|
||||
grunt.loadNpmTasks('grunt-jscs-checker');
|
||||
grunt.loadNpmTasks('grunt-recess');
|
||||
grunt.loadNpmTasks('grunt-saucelabs');
|
||||
grunt.loadNpmTasks('grunt-sed');
|
||||
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
|
||||
|
||||
// Docs HTML validation task
|
||||
grunt.registerTask('validate-html', ['jekyll', 'validation']);
|
||||
|
||||
// Test task.
|
||||
var testSubtasks = ['dist-css', 'jshint', 'jscs', 'qunit', 'validate-html'];
|
||||
var testSubtasks = [];
|
||||
// Skip core tests if running a different subset of the test suite
|
||||
if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'core') {
|
||||
testSubtasks = testSubtasks.concat(['dist-css', 'jshint', 'jscs', 'qunit']);
|
||||
}
|
||||
// Skip HTML validation if running a different subset of the test suite
|
||||
if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') {
|
||||
testSubtasks.push('validate-html');
|
||||
}
|
||||
// Only run Sauce Labs tests if there's a Sauce access key
|
||||
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined') {
|
||||
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined'
|
||||
// Skip Sauce if running a different subset of the test suite
|
||||
&& (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) {
|
||||
testSubtasks.push('connect');
|
||||
testSubtasks.push('saucelabs-qunit');
|
||||
}
|
||||
@@ -326,7 +355,7 @@ module.exports = function (grunt) {
|
||||
grunt.registerTask('dist-js', ['concat', 'uglify']);
|
||||
|
||||
// CSS distribution task.
|
||||
grunt.registerTask('dist-css', ['recess']);
|
||||
grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']);
|
||||
|
||||
// Fonts distribution task.
|
||||
grunt.registerTask('dist-fonts', ['copy']);
|
||||
|
||||
Reference in New Issue
Block a user