O
O
Oleg Morev2016-04-06 15:21:09
Less
Oleg Morev, 2016-04-06 15:21:09

How to install less?

Good afternoon, for the first time I put less, I can’t configure it)
What I did:
1) Downloaded Node.js
2) Also downloaded https://github.com/gruntjs/grunt-contrib-watch took only package.json files from here and Gruntfile.js
3) I put it in the tasks/less.min.js folder
4) I added it to the grant file

module.exports = function(grunt) {

  grunt.initConfig({

    less: {
      options: {
        paths: ['less']
      },
      files: {
        "css/main.css": "less/style.less"
      }
    },
    watch: {
      less: {
        files: [
          "less/**"
        ],
        tasks: "less:main"
      }
    }

  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');

  grunt.registerTask('default', ['less', 'watch']);

};

5) In package.json
{
  "name": "grunt-cli",
  "description": "The grunt command line interface",
  "version": "1.2.0",
  "author": "Grunt Development Team (http://gruntjs.com/development-team)",
  "repository": "gruntjs/grunt-cli",
  "license": "MIT",
  "engines": {
    "node": ">=0.10.0"
  },
  "main": "tasks/less.min.js",
  "scripts": {
    "test": "node bin/grunt test"
  },
  "bin": {
    "grunt": "bin/grunt"
  },
  "dependencies": {
    "findup-sync": "~0.3.0",
    "grunt-known-options": "~1.1.0",
    "nopt": "~3.0.6",
    "resolve": "~1.1.0"
  },
  "devDependencies": {
    "grunt": "^1.0.1",
    "grunt-contrib-concat": "^1.0.0",
    "grunt-contrib-jshint": "~1.0.0",
    "grunt-contrib-uglify": "^1.0.1",
    "grunt-contrib-watch": "^1.0.0"
  },
  "files": [
    "js"
  ],
  "appveyor_id": "prp6g944b05jsq6d"
}

6) How to further configure the watcher and so that everything is going)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2016-04-06
@k12th

remove less.min.js from the root and forget it.
Do like here: https://github.com/gruntjs/grunt-contrib-less

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question