@webscaffold/task-css-compiler

0.1.0-alpha.11 • Public • Published
Web Scaffold task-css-compiler

@web-scaffold/task-css-compiler

WEB Scaffold task for compiling Sass to css, running PostCSS and optimizing the output.

Install

$ npm install --save-dev @webscaffold/task-css-compiler

Usage

const cssCompiler = require('@webscaffold/task-css-compiler');

await cssCompiler('path/to/input.scss', 'path/to/output/folder', {
	taskName: 'css compiler',
	isDebug: true,
	buildPath: 'path/to/build/folder/for/asset-manifest-style.json',
	sass: {
		sourceMapEmbed: false 
	}
});

This will compile the entry Scss file to CSS will run PostCSS on top and based on settings will optimize the file with clean-css.

API

cssCompiler(input, destination, options?)

Returns a Promise<string[]> with the destination file paths.

input

Type: string

Entry sass file path.

destination

Type: string

Destination directory.

options

Type: object

Options object that can be passed.

sass

Type: object

Options are passed to Sass compiler.

taskName

Type: string
Default: css-compiler

Task name that will be used by the logger to namespace the logs.

taskColor

Type: string
Default: #FFD166

The color used by the logger to log to the console the task output.

eventBus

Type: object
Default: undefined

The EventEmitter event bus that will be used to emit bs:reload for Browsersync.

Licensing

MIT © Radu Micu

/@webscaffold/task-css-compiler/

    Package Sidebar

    Install

    npm i @webscaffold/task-css-compiler

    Weekly Downloads

    2

    Version

    0.1.0-alpha.11

    License

    MIT

    Unpacked Size

    12.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • radumza