sindresorhus / gulp-rev

Static asset revisioning by appending content hash to filenames: `unicorn.css` → `unicorn-d41d8cd98f.css`
MIT License
1.54k stars 217 forks source link

Not creating manifest correctly #255

Closed muuvmuuv closed 4 years ago

muuvmuuv commented 5 years ago

Description

In my project I have multiple sources that have multiple sub-sources and each is concatenated in a separate file. That is why I have used a loop to create tasks dynamically. Somehow rev is not handle that correctly. It always produces just one or some of the files I push to the gulp taks.

Steps to reproduce

  1. Use my gulpfile.js
  2. create a src-folder with mark.js and `plyr.js``
  3. install required dependencies from gulpfile
  4. run gulp
muuvmuuv commented 5 years ago

Seems to work with base set to the src or dist folder but then the manifest file is created in the root not in the dist folder where I want it to have.

muuvmuuv commented 5 years ago

Final solution: ....pipe(rev.manifest(${DEST}/manifest.json, { base: SRC, merge: true })) which is in my humble opinion not very neat.

Ritish-Madan commented 4 years ago

@muuvmuuv I am too facing the same problem as you are facing. rev-manifest is not producing all the sources from which I am building the gulp.

As per your solution. Can you please elaborate the keyword DEST and SRC? Are they a keyword or the destination and source locations of your files to be built?

muuvmuuv commented 4 years ago

Uhm, yes, those are variables (as you can see by ${). The formatting just break because of the backtick.

Ritish-Madan commented 4 years ago

Exactly, I tried something like ${/public/assets}/'manifest.json'. It stopped creating the manifest file. Can you please share a sample code you have used?

muuvmuuv commented 4 years ago

No, not this way man. ${} is the syntax to include variables inside template literals. I am not longer using that lib and idk how the initial config looked like but from my snippet it should look like this with static paths.

//...
...pipe(
  rev.manifest('./manifest.json', { 
    base: './',
    merge: true
  })
)
Ritish-Madan commented 4 years ago

Got that dude, Thank you for the help. 👍