2017 © Pedro Peláez
 

library sculpin-gulp-bundle

Run gulp tasks with sculpin generate

image

petemc/sculpin-gulp-bundle

Run gulp tasks with sculpin generate

  • Wednesday, April 13, 2016
  • by petemcfarlane
  • Repository
  • 0 Watchers
  • 0 Stars
  • 78 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

Sculpin Gulp Bundle

This bundle will allow you to run gulp tasks from the sculpin generage or sculpin generate --watch commands., (*1)

For example, you might want to build some SASS files to CSS, minify or concat your asset files., (*2)

Pre-requisites

This package currently isn't as fancy as to install npm or gulp, that task is left up to the user. These commands will install gulp as an npm package., (*3)

First make sure you have a package.json file with this command, (*4)

$ [ -f package.json ] && echo "package.json exists" || echo "{}" > package.json, (*5)

Require gulp as a dev dependancy, (*6)

$ npm install gulp --save-dev, (*7)

Check gulp is working, (*8)

$ gulp, (*9)

Create a gulpfile.js in your project root and put your tasks in there. You should name one task sculpin, as this will be run by the sculpin generate command (see example further down)., (*10)

Setup

Edit your sculpin.json file to include this package, then install by running sculpin update., (*11)

{
    "require": {
        "petemc/sculpin-gulp-bundle": "@dev"
    }
}

Create (or update an existing) app/SculpinKernel.php file to require the package with the following code:, (*12)

<?php

class SculpinKernel extends \Sculpin\Bundle\SculpinBundle\HttpKernel\AbstractKernel
{
    protected function getAdditionalSculpinBundles()
    {
        return [
            'PeteMc\Sculpin\SculpinGulpBundle\SculpinGulpBundle'
        ];
    }
}

How to use

Create a gulpfile.js in the root of your Sculpin project. Make sure you have a task called sculpin. This will be executed after each regeneration of the Sculpin site, either with sculpin generate or sculpin generate --watch, (*13)

Example gulpfile.js which runs one task to build sass:, (*14)

var gulp = require('gulp'),
    sass = require('gulp-sass'),
    cleanCss = require('gulp-clean-css');

gulp.task('sculpin', ['build-sass']);

gulp.task('build-sass', function () {
    return gulp.src('source/sass/style.sass')
        .pipe(sass())
        .pipe(cleanCss())
        .pipe(gulp.dest('output_dev/css/'))
        .pipe(gulp.dest('output_prod/css/'))
});

The Versions

13/04 2016

dev-master

9999999-dev

Run gulp tasks with sculpin generate

  Sources   Download

MIT

The Development Requires

by Pete McFarlane

13/04 2016

v0.0.1

0.0.1.0

Run gulp tasks with sculpin generate

  Sources   Download

MIT

The Development Requires

by Pete McFarlane