Grunt观看两个单独的LESS文件并输出到两个单独的CSS文件中

时间:2022-04-04 19:49:44

I'm using LESS for the my main app and also need a separate CSS file that isn't part of the main app. I'm trying to add a new source and destination to my existing grunt watch task

我正在使用LESS作为我的主应用程序,还需要一个不属于主应用程序的单独CSS文件。我正在尝试为我现有的grunt监视任务添加新的源和目标

less: {
    development: {
        options: {

            paths: ["path/to/less", "// path/to/2nd.less??"],
            yuicompress: true
        },
        files: {
            "path/to/build.css": ["path/to/less"]
        },
        //other src destination here?
        files: {
           "path/to/2nd.css": ["path/to/2nd.less"]
          }
        }
    }
},
watch: {
    files: ["path/to/less", "path/to/2nd.less"],
    tasks: ["less"]
}

1 个解决方案

#1


0  

thanks @jgillich for pointing me towards the docs. Solution:

感谢@jgillich指点我的文档。解:

less: {
    development: {
        options: {
        paths: ["path/to/less"],
        yuicompress: true
    },
    files: {
        "path/to/build.css": ["path/to/less"]
    },
  }
},
    2nd: {
options: {
 // same as above but with new paths
    }
  }
},
watch: {
    files: ["path/to/less", "path/to/2nd.less"],
    tasks: ["less"]
}

#1


0  

thanks @jgillich for pointing me towards the docs. Solution:

感谢@jgillich指点我的文档。解:

less: {
    development: {
        options: {
        paths: ["path/to/less"],
        yuicompress: true
    },
    files: {
        "path/to/build.css": ["path/to/less"]
    },
  }
},
    2nd: {
options: {
 // same as above but with new paths
    }
  }
},
watch: {
    files: ["path/to/less", "path/to/2nd.less"],
    tasks: ["less"]
}