@appius-digital/task-build-styles
v3.0.1
Published
Use this tool to process SCSS into production-ready CSS as part of your build process.
Downloads
26
Readme
Appius Build Tool: Build Styles
Use this tool to process SCSS into production-ready CSS as part of your build process.
Installation
Run the following command from your project root.
npm install @appius-digital/task-build-styles --save
Usage
Add the following to your gulpfile.js
require('@appius-digital/task-build-styles')(gulp, {
task: 'build-styles',
src: ['src/css/main.scss'],
dest: 'dist/css' });
Options
| Name | Type | Required | Default | Description |
| ---------------------------- | ---------- | ----------- | ---------------------- | -------------------------------------- |
| task | String | No | 'build-styles' | The name of the task to be initialised |
| src | Array | Yes | | The globs to be processed |
| dest | String | Yes | | Directory to place the processed files |
| plugins.autoprefixer.enabled | Boolean | No | true | Enable or disable autoprefixer |
| plugins.autoprefixer.config | Object | No | {}
| A set of autoprefixer options |
| plugins.cssnano.enabled | Boolean | No | true | Enable or disable cssnano (minifier) |
| plugins.cssnano.config | Object | No | {}
| A set of cssnano options |
| plugins.sourcemaps.enabled | Boolean | No | true | Enable or disable sourcemaps |
| plugins.sass.enabled | Boolean | No | true | Enable or disable sass |
| plugins.sass.config | Object | No | { precision: 5, outputStyle: 'expanded' }
| A set of node-sass options |
Configuration
In addition to any optional configuration applied to the individual plugins, autoprefixer will take the list of supported browsers from browserslist
property the package.json file. For example:
"browserslist": "last 2 version, iOS >= 8, Android >= 4.4, ie >= 10"
Copyright and license
Code and documentation Copyright 2019 Appius. Code released under the MIT License.