1.0.0-alpha.4 • Published 6 months ago
@hidoo/gulp-task-build-css-sass v1.0.0-alpha.4
@hidoo/gulp-task-build-css-sass
Task that build css by sass for gulp.
Installation
$ npm install --save-dev gulp @hidoo/gulp-task-build-css-sassUsage
basic:
import { task } from 'gulp';
import buildCss from '@hidoo/gulp-task-build-css-sass';
task(
'css',
buildCss({
src: '/path/to/scss/main.scss',
dest: '/path/to/dest'
})
);remove unused CSS:
import { task } from 'gulp';
import buildCss from '@hidoo/gulp-task-build-css-scss';
task(
'css',
buildCss({
src: '/path/to/scss/main.scss',
dest: '/path/to/dest',
uncssTargets: ['/path/to/target.html']
})
);API
csso
autoprefixer
cssmqpacker
defaultOptions
Default options.
Type: Object
name
src
dest
filename
suffix
banner
sassOptions
postcssPlugins
compress
verbose
buildCss
Return css build task by sass
Parameters
optionsObject options (optional, default{})options.nameString task name (use as displayName) (optional, default'build:css')options.srcString source pathoptions.destString destination pathoptions.filenameString destination filename (optional, default'main.css')options.suffixString suffix when compressed (optional, default'.min')options.targetsArray[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) target browsers.options.browsersArray[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) alias of options.targets.options.bannerString license comments (optional, default'')options.postcssPluginsObject list of PostCSS plugin. (optional, default[])options.verboseBoolean out debug log or not (optional, defaultfalse)
Examples
import { task } from 'gulp';
import buildCss, { autoprefixer } from '@hidoo/gulp-task-build-css-sass';
task(
'css',
buildCss({
name: 'css:main',
src: '/path/to/scss/main.scss',
dest: '/path/to/dest',
filename: 'styles.css',
suffix: '.hoge',
targets: ['> 0.1% in JP'],
banner: '/*! copyright <%= pkg.author %> * /\n',
sassOptions: { outputStyle: 'nested' },
postcssPlugins: [autoprefixer(), (root) => root],
compress: true
})
);Returns Function\
Test
$ npm testLicense
MIT
1.0.0-alpha.4
6 months ago
1.0.0-alpha.3
6 months ago
1.0.0-alpha.2
7 months ago
1.0.0-alpha.1
2 years ago
1.0.0-alpha.0
2 years ago
0.19.0
4 years ago
0.18.0
5 years ago
0.17.0
5 years ago
0.16.0
5 years ago
0.15.0
6 years ago
0.14.1
6 years ago
0.14.0
6 years ago
0.13.0
6 years ago
0.12.0
6 years ago
0.11.0
6 years ago
0.10.0
6 years ago