在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):IlyaAI/wro4j-gradle-plugin开源软件地址(OpenSource Url):https://github.com/IlyaAI/wro4j-gradle-plugin开源编程语言(OpenSource Language):Groovy 58.6%开源软件介绍(OpenSource Introduction):Wro4J Gradle PluginProvides build-time solution for wro4j with Gradle. Latest release: 1.8.0.Beta4 Getting StartedYou could find complete example here Step 1. Layout your web sourcesPut your web sources (html, js, css, less, etc) in the following folders:
Plugin treats all paths against Step 2. Apply pluginbuildscript {
repositories {
jcenter()
}
dependencies {
classpath 'ro.isdc.wro4j.gradle:wro4j-gradle-plugin:1.8.0.Beta4'
}
}
apply plugin: 'java'
apply plugin: 'wro4j' Wro4J plugin requires Java plugin to be applied first. Step 3. Add webjar dependenciesdependencies {
webjars 'org.webjars:jquery:2.1.4'
webjars 'org.webjars:bootstrap:3.3.4'
} Step 4. Define bundleswebResources {
bundle ('core') {
js 'js/**/*.js'
preProcessor 'jsMin'
}
bundle ('libs') {
js 'webjars/jquery/2.1.4/jquery.min.js'
}
bundle ('theme-default') {
css 'webjars/bootstrap/3.3.4/less/bootstrap.less'
css 'themes/default/main.css'
cssOverrideImport 'variables.less', '../../../../themes/default/variables.less'
preProcessor 'less4j'
cssRewriteUrl()
}
assets {
include 'themes/default/images/**'
}
} You could reference webjar's content just using Step 5. Build
When build finished you will get a jar with the following resources:
FAQHow should I use Bootstrap's glyph fonts?Way A. Spring.Boot includes /webjars/* handler enabled by default, so use Way B. If you do not use /webjars/* handler then you should copy fonts to you static
resources and reference Bootstrap via webResources {
assets {
include "webjars/bootstrap/$versionBootstrap/fonts/**"
}
}
dependencies {
webjars ("org.webjars:bootstrap:$versionBootstrap")
} Way C. It is also possible to use fonts from your static resources with enabled /webjars/* handler. webResources {
from ("$buildMainDir/webjars/bootstrap/$versionBootstrap/fonts") {
include '**'
into 'themes/default/fonts'
}
}
dependencies {
webjars ("org.webjars:bootstrap:$versionBootstrap")
} And override @icon-font-path: "../../../../themes/default/fonts/"; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论