3.0.1 • Published 5 years ago

@appius-digital/task-build-styles v3.0.1

Weekly downloads
5
License
UNLICENSED
Repository
-
Last release
5 years ago

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

NameTypeRequiredDefaultDescription
taskStringNo'build-styles'The name of the task to be initialised
srcArrayYesThe globs to be processed
destStringYesDirectory to place the processed files
plugins.autoprefixer.enabledBooleanNotrueEnable or disable autoprefixer
plugins.autoprefixer.configObjectNo{}A set of autoprefixer options
plugins.cssnano.enabledBooleanNotrueEnable or disable cssnano (minifier)
plugins.cssnano.configObjectNo{}A set of cssnano options
plugins.sourcemaps.enabledBooleanNotrueEnable or disable sourcemaps
plugins.sass.enabledBooleanNotrueEnable or disable sass
plugins.sass.configObjectNo{ 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.