Skip to content
Snippets Groups Projects
Commit d3fd0d5a authored by Robert Lange's avatar Robert Lange Committed by Dorian Merz
Browse files

refs #18286 [master] include print.scss in docker grunt task for scss to css compilation

* ignore print.css and compiled.css globally in finc gitignore and delete obsolete one in finc css folder
parent 5ed3ffe7
No related merge requests found
......@@ -23,3 +23,5 @@ import/solrmarc.log*
/docker-compose.override.yml
/docker-env.override.yml
/.env
**/compiled.css
**/print.css
\ No newline at end of file
......@@ -3,6 +3,10 @@ module.exports = function(grunt) {
var fs = require('fs');
/**
* @param {string} file
* @return {Array} retval - path to file as Array
*/
function getLoadPaths(file) {
var config;
var parts = file.split('/');
......@@ -201,9 +205,13 @@ module.exports = function(grunt) {
var sassConfig = {},
path = require('path'),
themeList = fs.readdirSync(path.resolve('themes')).filter(function (theme) {
return fs.existsSync(path.resolve('themes/' + theme + '/scss/compiled.scss'));
return fs.existsSync(path.resolve('themes/' + theme + '/scss/compiled.scss'))
|| fs.existsSync(path.resolve('themes/' + theme + '/scss/print.scss'));
});
/**
* Define mapping of input (scss) to output files (css) for following sass task
*/
for (var i in themeList) {
var config = {
options: {
......@@ -212,7 +220,7 @@ module.exports = function(grunt) {
files: [{
expand: true,
cwd: path.join('themes', themeList[i], 'scss'),
src: ['compiled.scss'],
src: ['compiled.scss', 'print.scss'],
dest: path.join('themes', themeList[i], 'css'),
ext: '.css'
}]
......@@ -220,7 +228,14 @@ module.exports = function(grunt) {
for (var key in this.data.options) {
config.options[key] = this.data.options[key] + '';
}
config.options.includePaths = getLoadPaths('themes/' + themeList[i] + '/scss/compiled.scss');
/* get Array of unique input paths */
config.options.includePaths = Array.from(
new Set(
getLoadPaths('themes/' + themeList[i] + '/scss/compiled.scss')
.concat(getLoadPaths('themes/' + themeList[i] + '/scss/print.scss'))
)
);
sassConfig[themeList[i]] = config;
}
......
compiled.css
\ No newline at end of file
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