Questions tagged [grunt-contrib-less]

Compile LESS files to CSS.

Grunt file to compile LESS files to CSS.

58 questions
0
votes
1 answer

Using Grunt to watch all files in my src directory and output to build

I'm completely new to Grunt and I want to use it in my next project. What I want to do is, for example, to have the file at src/server.coffee to be compiled to build/server.js and the file at src/public/assets/css/global.less to be compiled to…
0
votes
1 answer

Grunt task with grunt-contrib-less - how to compile multiple stylesheets while maintaining their original .less file name

I'm building a website with Bootstrap using less. I use grunt to automate the tasks. In my gruntfile.js I have this part: less: { compileCore: { options: { strictMath: true, sourceMap: true, outputSourceFiles: true, …
Meek
  • 3,086
  • 9
  • 38
  • 64
0
votes
1 answer

Grunt relative file path globbing

Is it possible to use Globbing partially on a directory in a file path? I have a grunt-contrib-less task set up, the file path for my task looks something like this: files: { "../../application/user/themes/some-theme-5.1.1.5830/css/main.css":…
HastingsDirect
  • 628
  • 1
  • 9
  • 17
0
votes
1 answer

Loading "less.js" tasks...ERROR when building pipeline on buddy.work, but on local is fine, why?

I'm trying to build a pipeline to deploy my website. I use grunt to compile less and minify CSS. This is how the gruntfile.js looks like: module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), …
Kyle
  • 135
  • 1
  • 12
0
votes
1 answer

Grunt - Unable to compile less to css using grunt-contrib-less

I've a good feeling i am doing something extremely silly here but i am not sure what. I am using grunt-contrib-less to compile less into css but it just doesn't seem to work at all. It shows no error or does anything and i am not sure why. please…
Kaushik Thirthappa
  • 1,041
  • 2
  • 9
  • 21
0
votes
1 answer

grunt-contrib-less: compilation on watch task removes sourcemap link

Here's my less task config: less: { development: { options: { compress: false, sourceMap: true, yuicompress: true, sourceMapFilename: 'export/style/app.css.map', sourceMapURL:…
valerio0999
  • 11,458
  • 7
  • 28
  • 56
0
votes
1 answer

Grunt-contrib-less fails with Angular-Material @media queries

I'm experiencing a strange error with angular-material & grunt-contrib-less. Every time i'm trying to run a simply grunt less task it fails with the following error message >> ParseError: media definitions require block statements after any features…
Vassilis Pits
  • 3,788
  • 4
  • 33
  • 48
0
votes
2 answers

Grunt less won't replace css file

I use grunt-contrib-less with grunt-contrib-watch to compile my less files automatically upon change. When the css is not present, grunt compiles it ok. When a css already exists and watch sees the less file changed, the css file is not modified. I…
Kodiak
  • 5,978
  • 17
  • 35
0
votes
1 answer

How do I change less compilation so that it doesn't add an @import statement?

I have a main.less file. I am running the grunt package: grunt-contrib-less on it to produce css. The generated css file has the following newly inserted at the top (with all other references correctly converted into css): @import…
sarin
  • 5,227
  • 3
  • 34
  • 63
0
votes
2 answers

Grunt so slow with watch multiple less tasks

I have a simple less files with very little contents but the compile time varies from 10 - 27s. Any ideas as to why? Is it my machine or the grunt settings that I am missing? Do I need to clear some sort of cache? Gruntfile.js…
Suthan Bala
  • 3,209
  • 5
  • 34
  • 59
0
votes
1 answer

Grunt won't process lesscss file

I am trying to concatenate a set of .less files into a big .less file, and then have it processed into a big .css file using Grunt's grunt-contrib-less module. module.exports = function(grunt) { require('load-grunt-tasks')(grunt); …
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
0
votes
0 answers

Grunt LESS force compile on error

I was wondering if it's possible to force grunt to compile LESS even if there is an error? The reason I ask is I'm outputting settings from the interface (Moodle) into less so that they can be changed by users. When I try to see a colour or do some…
Fony Tinlay
  • 59
  • 2
  • 12
0
votes
1 answer

"undefined is not a function" grunt less

Good afternoon , trying to deal with the assembly , but get the error: "undefined is not a function" My folder structure: -/less style.less --/components header.less -/css -/img -/js I installed : grunt-contrib-less and that my…
comSaaxov
  • 73
  • 1
  • 8
0
votes
1 answer

How to set resolve path for image-width?

I have a LESS file that refers to an absolute location (it needs to be absolute or grunt-usemin won't parse it properly), but this causes the less compiler to not be able to resolve the image when processing image-width(). /client/app/app.less //…
jt000
  • 3,196
  • 1
  • 18
  • 36
0
votes
1 answer

Grunt: How to generically run less task on multiple files that the watch task detects?

How can I set up my grunt script to run a less task on multiple files that the watch task detects? Is it possible to do this without using a "grunt.event.on('watch'..." hack? This solution works with one file, but when two files are saved at the…