mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Gruntfile: switch cssmin & jade tasks from files
over to src
& dest
Refs #14388.
This commit is contained in:
parent
da8daa667c
commit
559f16572f
1 changed files with 24 additions and 19 deletions
37
Gruntfile.js
37
Gruntfile.js
|
@ -19,6 +19,12 @@ module.exports = function (grunt) {
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var npmShrinkwrap = require('npm-shrinkwrap');
|
var npmShrinkwrap = require('npm-shrinkwrap');
|
||||||
var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');
|
var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');
|
||||||
|
var getLessVarsData = function () {
|
||||||
|
var filePath = path.join(__dirname, 'less/variables.less');
|
||||||
|
var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
|
||||||
|
var parser = new BsLessdocParser(fileContent);
|
||||||
|
return { sections: parser.parseFile() };
|
||||||
|
};
|
||||||
var generateRawFiles = require('./grunt/bs-raw-files-generator.js');
|
var generateRawFiles = require('./grunt/bs-raw-files-generator.js');
|
||||||
|
|
||||||
// Project configuration.
|
// Project configuration.
|
||||||
|
@ -233,11 +239,13 @@ module.exports = function (grunt) {
|
||||||
keepSpecialComments: '*',
|
keepSpecialComments: '*',
|
||||||
noAdvanced: true
|
noAdvanced: true
|
||||||
},
|
},
|
||||||
core: {
|
minifyCore: {
|
||||||
files: {
|
src: 'dist/css/<%= pkg.name %>.css',
|
||||||
'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css',
|
dest: 'dist/css/<%= pkg.name %>.min.css'
|
||||||
'dist/css/<%= pkg.name %>-theme.min.css': 'dist/css/<%= pkg.name %>-theme.css'
|
},
|
||||||
}
|
minifyTheme: {
|
||||||
|
src: 'dist/css/<%= pkg.name %>-theme.css',
|
||||||
|
dest: 'dist/css/<%= pkg.name %>-theme.min.css'
|
||||||
},
|
},
|
||||||
docs: {
|
docs: {
|
||||||
src: [
|
src: [
|
||||||
|
@ -312,20 +320,17 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
|
|
||||||
jade: {
|
jade: {
|
||||||
compile: {
|
|
||||||
options: {
|
options: {
|
||||||
pretty: true,
|
pretty: true,
|
||||||
data: function () {
|
data: getLessVarsData
|
||||||
var filePath = path.join(__dirname, 'less/variables.less');
|
|
||||||
var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
|
|
||||||
var parser = new BsLessdocParser(fileContent);
|
|
||||||
return { sections: parser.parseFile() };
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
files: {
|
customizerVars: {
|
||||||
'docs/_includes/customizer-variables.html': 'docs/_jade/customizer-variables.jade',
|
src: 'docs/_jade/customizer-variables.jade',
|
||||||
'docs/_includes/nav/customize.html': 'docs/_jade/customizer-nav.jade'
|
dest: 'docs/_includes/customizer-variables.html'
|
||||||
}
|
},
|
||||||
|
customizerNav: {
|
||||||
|
src: 'docs/_jade/customizer-nav.jade',
|
||||||
|
dest: 'docs/_includes/nav/customize.html'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue