2017 © Pedro Peláez
 

symfony-bundle js-templating-bundle

This bundle provides integration of gulp into Symfony2. Twigjs tag for twig.

image

tomfun/js-templating-bundle

This bundle provides integration of gulp into Symfony2. Twigjs tag for twig.

  • Tuesday, June 16, 2015
  • by tomfun1990@gmail.com
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

var gulp       = require('gulp'),
    _          = require('underscore'),
    execSync   = require('exec-sync'),
    //watch = require('gulp-watch'),

    exportPath = './web';

gulp.task('default', ['dump-bundles'], function () {
    var bower           = require('main-bower-files'),
        bowerNormalizer = require('gulp-bower-normalize'),
        bowerData       = bower();
    return gulp.src(bowerData, {base: './bower_components'})
        .pipe(bowerNormalizer({bowerJson: './bower.json', flatten: true}))
        .pipe(gulp.dest(exportPath));
});

gulp.task('dump-bundles', function () {
    var myData = execSync('app/console tommy:js:dump --screen');
    var colors = require('colors/safe');
    myData = JSON.parse(myData);
    _.each(myData, function (data, type) {
        var was = {};
        _.each(data, function (path, dest) {
            if (!was.hasOwnProperty(path)) {
                was[path] = [];
            }
            was[path].push(dest);
        });
        _.each(was, function (dests, path) {
            if (dests.length > 1) {
                _.each(dests, function (dest) {
                    console.log(colors.yellow(dest) + " (" + exportPath + "/" + type + dest.substr(1) + ")\n");
                });
                console.log(
                    colors.green("  file:\n")
                    + path
                    + colors.green("\n  was already placed by:\n")
                );
            }
        });
    });
    var src = myData.js;
    _.each(src, function (path, dest) {
        dest = dest.substr(1);
        dest = dest.replace(/\/[^\/]+$/, '');
        //process one by one
        gulp.src(path/*, {base: './bower_components'}*/)
            //.pipe(normalize, compress, ...)
            .pipe(gulp.dest(exportPath + '/js' + dest));
    });
});

The Versions

16/06 2015

dev-master

9999999-dev

This bundle provides integration of gulp into Symfony2. Twigjs tag for twig.

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Kevin Montag
by Bogdan Yurov
by Grigory Kotov