Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest.json not produced on multiple level folders #234

Open
alejpelo opened this issue Nov 21, 2017 · 0 comments
Open

Manifest.json not produced on multiple level folders #234

alejpelo opened this issue Nov 21, 2017 · 0 comments

Comments

@alejpelo
Copy link

Description

When the rev command is run everything works and revisioned files (unicorn.cssunicorn-d41d8cd98f.css) appear in the desired folder. However, when the rev.manifestcommand is invoqued, the rev-manifest.json file is not produced.

Steps to reproduce

I have the following folder structure with all my .min.css, .min.js and image (.jpg, .png, .jpeg) assets:

si-vet
│
└───siv
│   │   
│   └───static
│       │   
│       └───img
│       │   │   
│       │   └───folder_img1
│       │   │   │   img1.png
│       │   │   │   ...
│       │   │
│       │   └───folder_img2
│       │       │   img2.png
│       │       │   img3.jpg
│       │       │   ...
│       │   ...
│       │
│       └───vet
│           │   style.min.css
│           │
│           └───folder_vet1
│           │   │    script1.min.js
│           │   │    script2.min.js
│           │   │   ...
│           │
│           └───folder_vet2
│           │   │    script3.min.js
│           │   │    script4.min.js
│           │   │   ...
│           │   ...
│   ...

In order to get revisioned files in the same place as the original assets, I use the following gulp.task:

var gulp = require('gulp');
var rev = require('gulp-rev');

gulp.task('revision', function() {
  return gulp.src([
        'siv/static/img/**/*.{jpg,png,jpeg}',
        'siv/static/vet/**/*.min.css',
        'siv/static/vet/**/*.min.js'
        ],
        { base: 'siv/static' })
    .pipe(rev())
    .pipe(gulp.dest(function(file) {
        return file.base;
    }))
});

As I mentioed before, after this gulp.task is run, I get the revisioned files (unicorn.cssunicorn-d41d8cd98f.css) and the task finishes as expected:

alejandro@ubuntu:~/WebApp/si-vet$ gulp revision
[18:02:47] Using gulpfile ~/WebApp/si-vet/gulpfile.js
[18:02:47] Starting 'revision'...
[18:02:47] Finished 'revision' after 30 ms
alejandro@ubuntu:~/WebApp/si-vet$ 

However, when I include the command to get the rev-manifest.json file in the gulp.task, as follows:

var gulp = require('gulp');
var rev = require('gulp-rev');

gulp.task('revision', function() {
  return gulp.src([
        'siv/static/img/**/*.{jpg,png,jpeg}',
        'siv/static/vet/**/*.min.css',
        'siv/static/vet/**/*.min.js'
        ],
        { base: 'siv/static' })
    .pipe(rev())
    .pipe(gulp.dest(function(file) {
        return file.base;
    }))
    .pipe(rev.manifest({
        base: 'siv/static',
    }))
    .pipe(gulp.dest('siv/static'));
});

The task never finishes and the rev-manifest.json is not produced:

alejandro@ubuntu:~/WebApp/si-vet$ gulp revision
[18:03:14] Using gulpfile ~/WebApp/si-vet/gulpfile.js
[18:03:14] Starting 'revision'...
alejandro@ubuntu:~/WebApp/si-vet$ 

For the record I'm a gulp and gulp-rev newbie, so please excuse any mistakes in my approach. I tryed for several hours and read many websites but nothing has worked so far. I'm using Ubuntu 16.04 LTS, Node v4.2.6 and gulp-rev 8.1.0.

Thanks in advance for any help with the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant