1

LessCss-Gradle-Plugin ( https://github.com/obecker/gradle-lesscss-plugin )を介して Less-Files から CSS ファイルを生成したいと考えています。

私のbuild.gradleでは、ブートストラップなどのwebjar依存関係を追加しました..

dependencies {
implementation project(':pet-clinic-data')
implementation 'org.springframework.boot:spring-boot-starter-actuator:2.3.2.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:2.3.2.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-web:2.3.2.RELEASE'
implementation 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
implementation 'org.webjars:webjars-locator-core:0.45'
implementation 'org.webjars:jquery:2.2.4'
implementation 'org.webjars:jquery-ui:1.11.4'
implementation 'org.webjars:bootstrap:3.3.6'
runtimeOnly 'org.springframework.boot:spring-boot-devtools:2.3.2.RELEASE'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.3.2.RELEASE'
compile group: 'org.springframework', name: 'spring-tx', version: '5.2.8.RELEASE'
}

そして私のlesscss-Task:

lesscss {
source = fileTree('src/main/less') {
    include '**/*.less'

}
dest = "$buildDir/resources/main/static/resources/css"

dependencies {
    compile 'org.webjars:bootstrap:3.3.6'
    compileClasspath 'org.webjars:bootstrap:3.3.6'
}
}

bootstrap-webjar のクラスからの要素を必要とするいくつかの less-Files があります (例: label-success)。外部依存関係に webjar がありますが、@Import-Statement を使用してそれにリンクするにはどうすればよいですか? 私は次のようなものを試しました:

@import "classpath: resources/webjars/bootstrap/3.3.6/less/bootstrap.less";
@import "classpath:META- 
 INF/resources/webjars/bootstrap/3.3.6/less/bootstrap.less"
4

0 に答える 0