Giter Club home page Giter Club logo

gulp-tasks's Introduction

Yakamara Gulp Tasks

Installation

npm

npm install @yakamara/gulp-tasks --save-dev

yarn

yarn add @yakamara/gulp-tasks --dev

Usage

Example gulpfile.js/index.js

const gulp = require('gulp');
const init = require('@yakamara/gulp-tasks').require('init');

require('dotenv').config({
    path: '.env.local'
});

require('./config');

const tasks = {
    build: gulp.series(
        init.gulpTask({
            production: 'prod' === process.env.APP_ENV,
            watching: false,
        }),
        'clean',
        gulp.parallel(
            'styles',
            'scripts',
            'modernizr',
            'images',
            'copy',
        )
    ),

    watch: gulp.series(
        init.gulpTask({
            production: 'prod' === process.env.APP_ENV,
            watching: true,
        }),
        'clean',
        'styles',
        'scripts',
        'modernizr',
        'images',
        'copy',
        'browser-sync',
    ),
};

gulp.task('build', tasks.build);
gulp.task('watch', tasks.watch);
gulp.task('default', 'prod' === process.env.APP_ENV ? tasks.build : tasks.watch);

Example gulpfile.js/config.js

const tasks = require('@yakamara/gulp-tasks');

tasks.require('browserSync').configure({
    proxy: process.env.APP_HOST,
});

tasks.require('clean').configure({
    paths: './public/assets/{fonts,images,styles,scripts,svgs}/**/*',
});

tasks.require('styles').configure({
    source: './assets/styles/*.scss',
    destination: './public/assets/styles',
    // sassVariables: {},
    // cssnano: {},
});

tasks.require('scripts').configure({
    source: './assets/scripts/script.js',
    destination: './public/assets/scripts',
});

tasks.require('modernizr').configure({
    destination: './public/assets/scripts',
    // modernizr: {}
});

const copy = tasks.require('copy');
copy.create('fonts', {
    source: './assets/fonts',
    files: '**/*.{woff,woff2}',
    destination: './public/assets/fonts'
});
copy.create('FontAwesome', {
    source: './node_modules/font-awesome/fonts',
    files: '*.{woff,woff2}',
    destination: './public/assets/fonts'
});

tasks.require('images').configure({
    source: './assets/images',
    destination: './public/assets/images'
});

gulp-tasks's People

Contributors

gharlan avatar tbaddade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

olien

gulp-tasks's Issues

Warnings

warning @yakamara/gulp-tasks > gulp-cssnano > cssnano > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @yakamara/gulp-tasks > gulp-cssnano > cssnano > postcss-merge-rules > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @yakamara/gulp-tasks > gulp-cssnano > cssnano > postcss-merge-rules > caniuse-api > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @yakamara/gulp-tasks > gulp-imagemin > imagemin-gifsicle > gifsicle > bin-build > download > gulp-decompress > [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

Update dependencies

warning @yakamara/gulp-tasks > modernizr > [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
warning @yakamara/gulp-tasks > gulp-sass > node-sass > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning @yakamara/gulp-tasks > gulp-sass > node-sass > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

Task image : Abhängigkeiten aktualisieren

Während des Deployen kam dieser Fehler:

Error Output:
  ================
  [14:33:38] 'images:images' errored after 569 ms
  [14:33:38] TypeError in plugin "gulp-imagemin"
  Message:
      fn is not a function

Lösung für mich war, erst einmal den image-Task nicht zu verwenden.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.