GCSSBuilder
Transpiles sass/scss/less/postcss files into css. postcss can be used together with sass/scss/less. PostCSS is enabled by default (from v3.1) unless it's turned off intentionally.
Builder specific Options
Available options for BuildConfig.buildOptions:
Option | Type | Default | Description |
---|---|---|---|
sourceMap | boolean | false | Enable sourceMap generation. |
lint | boolean | false | Enable linter. |
minify | boolean | false | Generate minified *.min.js in addition to non-minified output. |
minifyOnly | boolean | false | Generate minified *.min.js files only with no non-minified output. |
outFileOnly | boolean | true | Generate concatenated outfile only. This option is valid only when BuildConfig.outFile is set. |
postcss | boolean | true | Enable PostCSS. PostCSS automatically handles auto-prefixing without autoPrefixer. |
sourceType | string | 'scss' | Specifies input source type. Possible values are 'css', 'scss', 'sass', 'less'. |
autoPrefixer | boolean | true | Enable autoPrefixer. If postcss option is enabled(default), this is ignored in preference to auto-prefixing feature of postcss. |
Notes
- linter is using stylelint with postcss. So, if lint is enabled, postcss is automatically enabled and the required postcss packages should be installed.
Example
const sass = {
name: 'sass',
builder: 'GCSSBuilder',
src: [upath.join(srcRoot, 'scss/**/*.scss')],
dest: upath.join(destRoot, 'css'),
buildOptions: {
sourceType: 'scss',
sourceMap: true,
lint: true,
minify: true,
// autoPrefixer: true,
postcss: true
},
moduleOptions: {
sass: { includePaths: ['assets/scss'] },
postcss: {
plugins: [
require('postcss-cssnext'),
require('postcss-utilities'),
require('lost'),
]
}
stylelint: {
configFile: upath.join(srcRoot, '.stylelintrc')
}
}
};