Commit 559f1657 authored by Chris Rebert's avatar Chris Rebert

Gruntfile: switch cssmin & jade tasks from `files` over to `src` & `dest`

Refs #14388.
parent da8daa66
...@@ -19,6 +19,12 @@ module.exports = function (grunt) { ...@@ -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) { ...@@ -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) { ...@@ -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'
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment