@coldfrontlabs/gulp-templates
v6.0.0
Published
Templates for quick gulp task set-up.
Downloads
452
Readme
@coldfrontlabs/gulp-templates
Templates for quick gulp task set-up.
This project assumes users have a basic understanding of how Gulp works. If you require more information on the basics of Gulp, please read the official documentation.
Installation
# latest stable
npm install -D gulp
npm install -D @coldfrontlabs/gulp-templates
Features
CSS
JavaScript
Libraries/Dependencies
Sass/SCSS
Upgrading from version 1.x?
Check out the upgrade guide!
Sample gulpfile.js
This file will give you a basic example of how to use the templates.
const { series } = require("gulp");
const { js } = require("@coldfrontlabs/gulp-templates");
/**
* Compiles all JS files using Babel.
*
* @returns {object} - Gulp stream.
*/
const compile = () =>
js.compile({
source: "src/js/**/*.js",
destination: "dist/js",
});
/**
* Minifies all JS files.
*
* @returns {object} - Gulp stream.
*/
const minify = () =>
js.minify({
source: ["dist/js/*.js", `!dist/js/*.min.js`],
destination: "dist/js",
});
const build = series(compile, minify);
build.description = "Compiles, and minifies all JS files.";
exports.default = build;
Using the latest JavaScript version
If you want to use the latest greatest JavaScript, follow the setup instructions for Gulp on the official package.
Here is the example from above written in ES2015.
import { series } from "gulp";
import { js } from "@coldfrontlabs/gulp-templates";
/**
* Compiles all JS files using Babel.
*
* @returns {object} - Gulp stream.
*/
const compile = () =>
js.compile({
source: "src/js/**/*.js",
destination: "dist/js",
});
/**
* Minifies all JS files.
*
* @returns {object} - Gulp stream.
*/
const minify = () =>
js.minify({
source: ["dist/js/*.js", `!dist/js/*.min.js`],
destination: "dist/js",
});
const build = series(compile, minify);
build.description = "Compiles, and minifies all JS files.";
export default build;
More examples can be found here.
Versioning
This project uses Semantic Versioning 2.0.0 to keep track of releases.
For more detailed information about SemVer, please see the official documentation.
Contributing
If you're interested in contributing to the project, please read the Contribution Guidelines. Any and all contributions must follow these guidelines or they will not be accepted.