Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9051905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:01:46+00:00 2026-06-16T13:01:46+00:00

All .js and .less files are builded in my project with gruntjs (built-in .js

  • 0

All .js and .less files are builded in my project with gruntjs (built-in .js support) and grunt-less-contrib plugin for tasks with .less files.

For a moment lesscss compresses css in one-definition-per-line style, for example for following .less file:

div,span,textarea,input {
  margin:0;
}

It will output:

div,
span,
textarea,
input {
  margin:0;
}

I want to compress all css into one line, for this example it should look like:

div,span,textarea,input{margin:0;}...other styles...

Is it possible? Any advice will be helpful, I am not sure that this is a question straight about lesscss or grunt.

Maybe it is possible to add a task after build.css is built, and then perform concatenation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:01:47+00:00Added an answer on June 16, 2026 at 1:01 pm

    The grunt-contrib-less plugin is also enough to minify the compiled CSS. You don’t need another plugin to minify your code.

    It has two options specific for this use-case:

    • compress (will remove some whitespaces):

      less: {
          compile: {
              options: {
                  paths: ["foo/bar/css"],
                  compress: true
              },
              files: {
                  "path/to/result.css": "path/to/source.less"
              }
          }
      }
      

      https://github.com/gruntjs/grunt-contrib-less/#compress

    • yuicompress (will run your CSS through css-min internally):

      less: {
          compile: {
              options: {
                  paths: ["foo/bar/css"],
                  yuicompress: true
              },
              files: {
                  "path/to/result.css": "path/to/source.less"
              }
          }
      }
      

      https://github.com/gruntjs/grunt-contrib-less/#yuicompress

    So in your case “yuicompress” would be the right thing to add to your gruntfile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several LESS files that are all imported into one master file (styles.less).
We've started to use twitter's bootstrap, specifically just all the .less files. One thing
I have 2 LESS files. Globals.less and Site.less. Globals.less contains all of my global
I have a project with less files which reference images via URLs. The project
I want to delete all files in a folder that are less than 200
I like to get all .less files in a Directory with Subdirectories. I have
I'm looking to write a bash script that will recursively find all .less files
My intentions is to make all *.less files into style.css I am not very
I need to write a query that returns all object less that or equal
The title more or less says it all. I create a widget, add it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.