https://plugins.gradle.org/plugin/com.matsuyoido.frontend
- sass compile by jsass
- css minify by YUI Compressor
- css add prefix by CanIUse and ph-css
- js minify by YUI Compressor or Google Closure Compiler
group: Compile tasks
$ gradlew sassCompile
$ gradlew cssMinify
$ gradlew jsMinify
$ gradlew jsMerge
frontend {
setting {
// If you want to set encoding. 'windows' or 'linux' or 'mac'
lineEnding = 'linux'
// If you want to add prefixer, set values.
prefixer {
// specify data.json from https://github.com/Fyrd/caniuse/blob/master/data.json
// If don't set, download from https://github.com/Fyrd/caniuse/blob/master/data.json to "$rootDir/gardle/plugin/data.json".
// If download error, used from caniuse-db-1.0.30000748
caniuseData = file("$rootDir/caniuse/data.json")
// If set version string(ex. "76" or "all"), specified greater version check css supports & add prefixer.
ie = ""
edge = ""
chrome = ""
firefox = ""
safari = ""
ios = ""
android = ""
}
}
style {
scss {
inDir = file("$projectDir/src/main/sass")
outDir = file("$projectDir/src/main/resources/static/css")
// If you compile and minify, set true.
enableMinify = true
// If you want to add prefixer, set true.
addPrefixer = true
}
// you can multiple block `scss`.
scss {
inDir = file("$rootDir/resources/vendor")
outDir = file("$projectDir/src/main/resources/static/css")
}
}
}
frontend {
setting {
// If you want to set encoding. 'windows' or 'linux' or 'mac'
lineEnding = 'linux'
// If you want to add prefixer, set values.
prefixer {
// specify data.json from https://github.com/Fyrd/caniuse/blob/master/data.json
// If don't set, download from https://github.com/Fyrd/caniuse/blob/master/data.json to "$rootDir/gardle/build/data.json".
// If download error, used from caniuse-db-1.0.30000748
caniuseData = file("$rootDir/caniuse/data.json")
// If set version string(ex. "76" or "all"), specified greater version check css supports & add prefixer.
ie = ""
edge = ""
chrome = ""
firefox = ""
safari = ""
ios = ""
android = ""
}
}
style {
css {
inDir = file("$projectDir/src/main/sass")
outDir = file("$projectDir/src/main/resources/static/css")
// If you want to add prefixer, set true.
addPrefixer = true
}
// you can multiple block `css`.
css {
inDir = file("$rootDir/resources/vendor")
outDir = file("$projectDir/src/main/resources/static/css")
}
}
}
frontend {
script {
js {
inDir = file("$projectDir/src/main/resources/static/js")
outDir = file("$projectDir/src/main/resources/static/js")
// If you want to specify minify compiler. 'google' (Default) or 'yahoo'
type = 'google'
}
// you can multiple block `js`.
js {
inDir = file("$rootDir/resources/vendor")
outDir = file("$projectDir/src/main/resources/static/js")
}
}
}
frontend {
script {
js {
inDir = file("$projectDir/src/main/resources/static/js")
outDir = file("$projectDir/src/main/resources/static/js")
}
// you can multiple block `js`.
js {
inDir = file("$rootDir/resources/vendor")
outDir = file("$projectDir/src/main/resources/static/js")
}
}
}
frontend {
setting {
lineEnding = 'linux'
prefixer {
caniuseData = file("$rootDir/your/fit/version/data.json")
ie = "all"
edge = "42"
chrome = ""
firefox = ""
safari = ""
ios = ""
android = ""
}
// If you want to happen error stop, set value false.(default is true.)
skipError = false
}
style {
scss {
inDir = file("$projectDir/your/scss/directory")
outDir = file("$projectDir/your/css/output/directory")
enableMinify = true
addPrefixer = true
}
css {
inDir = file("$projectDir/your/css/directory")
outDir = file("$projectDir/your/css/output/directory")
addPrefixer = true
}
}
script {
js {
inDir = file("$projectDir/your/javascript/directory")
outDir = file("$projectDir/your/javascript/output/directory")
type = 'google'
}
}
}
- target:
.scss
files - output:
.css
file- If you set
enableMinify = true
, becomes.min.css
file
- If you set
- fileName: scss file name
- target:
.css
files - output:
.min.css
file - fileName: css file name
- target:
.js
files - output:
.min.js
file - fileName: js file name
- target:
.js.map
files- this content is json file.
- 「key:
sources
」's value is type of string array and value is js file path.
- output:
.min.js
file - fileName: map file name
please create New Issue
in Japanese or English.
(Japanese is better...)