Skip to content
Snippets Groups Projects
Commit c35dd1d0 authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Add lessdev Grunt task (#971)

- Creates CSS source maps
- Does not compress CSS
- Can be watched with `grunt watch:lessdev`
parent 6468d909
No related merge requests found
...@@ -28,25 +28,31 @@ module.exports = function(grunt) { ...@@ -28,25 +28,31 @@ module.exports = function(grunt) {
} }
var fontAwesomePath = '"../../bootstrap3/css/fonts"'; var fontAwesomePath = '"../../bootstrap3/css/fonts"';
var lessFileSettings = [{
expand: true,
src: "themes/*/less/compiled.less",
rename: function (dest, src) {
return src.replace('/less/', '/css/').replace('.less', '.css');
}
}];
grunt.initConfig({ grunt.initConfig({
// LESS compilation // LESS compilation
less: { less: {
compile: { compile: {
files: lessFileSettings,
options: { options: {
paths: getLoadPaths, paths: getLoadPaths,
compress: true, compress: true,
modifyVars: { modifyVars: {
'fa-font-path': fontAwesomePath 'fa-font-path': fontAwesomePath
} }
}, }
files: [{ }
expand: true, },
src: "themes/*/less/compiled.less", // Less with maps
rename: function (dest, src) { lessdev: {
return src.replace('/less/', '/css/').replace('.less', '.css'); less: {
}
}]
} }
}, },
// SASS compilation // SASS compilation
...@@ -132,12 +138,34 @@ module.exports = function(grunt) { ...@@ -132,12 +138,34 @@ module.exports = function(grunt) {
files: 'themes/*/less/**/*.less', files: 'themes/*/less/**/*.less',
tasks: ['less'] tasks: ['less']
}, },
lessdev: {
files: 'themes/*/less/**/*.less',
tasks: ['lessdev']
},
scss: { scss: {
files: 'themes/*/scss/**/*.scss', files: 'themes/*/scss/**/*.scss',
tasks: ['scss'] tasks: ['scss']
} }
} }
}); });
grunt.registerMultiTask('lessdev', function lessWithMaps() {
grunt.config.set('less', {
dev: {
files: lessFileSettings,
options: {
paths: getLoadPaths,
sourceMap: true,
sourceMapFileInline: true,
modifyVars: {
'fa-font-path': fontAwesomePath
}
}
}
});
grunt.task.run('less');
});
grunt.registerMultiTask('scss', function sassScan() { grunt.registerMultiTask('scss', function sassScan() {
var sassConfig = {}, var sassConfig = {},
path = require('path'), path = require('path'),
......
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