dev-master
9999999-devRun gulp tasks with sculpin generate
MIT
The Development Requires
by Pete McFarlane
v0.0.1
0.0.1.0Run gulp tasks with sculpin generate
MIT
The Development Requires
by Pete McFarlane
Wallogit.com
2017 © Pedro Peláez
Run gulp tasks with sculpin generate
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)
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)
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'
];
}
}
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/'))
});
Run gulp tasks with sculpin generate
MIT
Run gulp tasks with sculpin generate
MIT