Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

How to overwrite sourceMap options in lesscDaemon task? #3

Closed
czterystaczwarty opened this issue Sep 3, 2015 · 1 comment
Closed

Comments

@czterystaczwarty
Copy link

I want to generate two different stylesheets production - compressed and develop - with sourceMaps.
How can I overwrite options from lesscDaemon task?

lessc {
    sourceDir "src/less"
    include "*.less"
    def destDir = "${buildDir}/generated-sources/less"
    destinationDir "${destDir}/_css_common"
    options.compress = true
    sourceSets.main.resources.srcDir destDir
}
processResources.dependsOn lessc

lesscDaemon {
    //  Could not find property 'options' on task ':war-common:lesscDaemon'.
    options.compress = false
    options.sourceMap = true
    options.sourceMapBasepath = "${buildDir}/generated-sources/less"
    options.sourceMapLessInline = true
}
@houbie
Copy link
Owner

houbie commented Sep 3, 2015

You can define multiple lessc tasks for development, production, etc., but this doesn't work for the lesscDaemon. The lesscDaemon task is only intended for development purposes: automatic compilation when saving a less file. Gradle 2.5 and later have event better and built-in support for automatic compilation (https://docs.gradle.org/current/userguide/continuous_build.html).

BTW: this plugin has been superseded by the less asset pipeline plugin: https://github.com/bertramdev/less-asset-pipeline

@houbie houbie closed this as completed Sep 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants