定制 petemc/sculpin-gulp-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

petemc/sculpin-gulp-bundle

Composer 安装命令:

composer require petemc/sculpin-gulp-bundle

包简介

Run gulp tasks with sculpin generate

README 文档

README

This bundle will allow you to run gulp tasks from the sculpin generage or sculpin generate --watch commands.

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

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.

First make sure you have a package.json file with this command

$ [ -f package.json ] && echo "package.json exists" || echo "{}" > package.json

Require gulp as a dev dependancy

$ npm install gulp --save-dev

Check gulp is working

$ gulp

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).

Setup

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

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

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

<?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

Example gulpfile.js which runs one task to build sass:

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/'))
});

统计信息

  • 总下载量: 105
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固