Grunt, Less, and File Watching

前端 未结 1 1875
走了就别回头了
走了就别回头了 2020-12-24 13:04

I\'m trying to get grunt working to do something. My project looks like this:

/app
    /assets
        /components
        /stylesheets
            /less
            


        
相关标签:
1条回答
  • 2020-12-24 13:52

    I got it working with the following!

    module.exports = function(grunt) {
        grunt.initConfig({
            less: {
                development: {
                    options: {
                        paths: ["./assets/stylesheets/less"],
                        yuicompress: true
                    },
                    files: {
                        "./assets/stylesheets/css/style.css": "./assets/stylesheets/less/style.less"
                    }
                }
            },
            watch: {
                files: "./assets/stylesheets/less/*",
                tasks: ["less"]
            }
        });
        grunt.loadNpmTasks('grunt-contrib-less');
        grunt.loadNpmTasks('grunt-contrib-watch');
    };
    
    0 讨论(0)
提交回复
热议问题