strt-gulptasks
v4.4.3
Published
Collection of gulp tasks.
Downloads
11
Readme
Features ✌️
- ES6 with Babel
- BrowserSync and Webpack dev middleware
- Sass
- Image compression
- SVG icon sprites
Available tasks 🔥
- Clean
- Files
- Icons
- Images
- Scripts
- Serve
- Styles
- Watch
Options 🔧
{
source: 'src', // Source folder
output: 'dist', // Output folder
browsers: ['ie 11', 'last 2 versions'], // Supported browsers, used by autoprefixer and babel
images: {
path: 'images', // Images path
},
icons: {
path: 'icons', // Icons path
},
styles: {
path: 'styles', // Styles path
entries: ['./main.scss'], // Styles entries
},
scripts: {
path: 'scripts', // Scripts path
publicPath: '', // PublicPath of scripts, e.g. /dist/scripts or /webdav/files/dist/scripts
entries: ['./main.js'], // Scripts entries, use and object if you need to name the javascript file, e.g. { named: './named.js' } will output named.js
},
serve: {} // Sends config object directly to BrowserSync, see their docs for available options
/* BrowserSync proxy example
serve: {
proxy: 'strateg.se',
serveStatic: [
{
route: '/webdav/files/resources',
dir: 'dist'
}
]
}
*/
}
Getting started 🚀
yarn add strt-gulptasks
Example
// gulpfile.js
const gulp = require('gulp');
const tasks = require('strt-gulptasks')({
// Options
});
gulp.task('default', gulp.series(
tasks.clean,
gulp.parallel(
tasks.styles,
tasks.images,
tasks.icons,
tasks.files,
tasks.scripts
),
tasks.serve
));