gulp-rev icon indicating copy to clipboard operation
gulp-rev copied to clipboard

Static asset revisioning by appending content hash to filenames: `unicorn.css` → `unicorn-d41d8cd98f.css`

Results 16 gulp-rev issues
Sort by recently updated
recently updated
newest added

The corresponding image path string does not exist in the css file, what should I do?

[{"_id":"632087141a26130c7b1eb132","body":"@Richienb \r\n@sindresorhus ","issue_id":1660110394887,"origin_id":980838328,"user_origin_id":30773389,"create_time":1638073874,"update_time":1638073874,"id":1663076116415,"updated_at":"2022-09-13T13:35:16.415000Z","created_at":"2022-09-13T13:35:16.415000Z"},{"_id":"632087141a26130c7b1eb133","body":"is this still relevant?","issue_id":1660110394887,"origin_id":1177721889,"user_origin_id":10898370,"create_time":1657204798,"update_time":1657204798,"id":1663076116420,"updated_at":"2022-09-13T13:35:16.420000Z","created_at":"2022-09-13T13:35:16.420000Z"}] comment

### Description https://www.npmjs.com/package/flag-icon-css #### Steps to reproduce style.css ``` .flag-icon-ad { background-image: url(../flags/1x1/ad.svg); } ``` rev-manifest.json ` "flag-icon-css/flags/1x1/ad.svg": "flag-icon-css/flags/1x1/ad-e15ddeabbf.svg", ` 无法实现图片url的替换。 nodejs版本: ^12.0.0

> No, locking is not the right answer. Do what @BerkeleyTrue said and you should be good :) > > _Originally posted by @bobthecow in https://github.com/sindresorhus/gulp-rev/issues/115#issuecomment-138101135_ > With regards to...

hi can anyone please give me a hand in how i can keep the filenames unchanged and get the manifest.js to this format ``` { "file.ext": "hash", } ``` for...

Wrong directory in manifest

[{"_id":"632087141a26130c7b1eb134","body":"What is the structure of `source\/sass`?\n\nI think you need to (1) include `{base: 'source'}` within `gulp.src`as seen [here](https:\/\/github.com\/sindresorhus\/gulp-rev#asset-manifest) or (2) split this into two streams so that the first writes into `build\/css` and then the second sources the same directory. (This \"second stream\" would look nearly identical to the linked example.\n","issue_id":1660110394894,"origin_id":255794741,"user_origin_id":5855893,"create_time":1477327180,"update_time":1477327180,"id":1663076116806,"updated_at":"2022-09-13T13:35:16.806000Z","created_at":"2022-09-13T13:35:16.806000Z"},{"_id":"632087141a26130c7b1eb135","body":"I have the same issue, even with `{base: 'source'}`.\r\n\r\nThis is my task:\r\n```js\r\ngulp.task('sass', function () {\r\n return gulp.src('scss\/*.{sass,scss}', {cwd: '.\/src', base: '.\/src'})\r\n .pipe(sass({\r\n includePaths: [\r\n '.\/bower_components'\r\n ],\r\n precision: 2,\r\n sourceMap: true,\r\n sourceMapEmbed: true,\r\n outputStyle: 'compact'\r\n }).on('error', sass.logError))\r\n .pipe(rev())\r\n .pipe(gulp.dest('.\/public\/css'))\r\n .pipe(rev.manifest({\r\n base: '.\/',\r\n merge: true\r\n }))\r\n .pipe(gulp.dest('.\/'));\r\n});\r\n```\r\n\r\nThis is the `rev-manifest.json` content:\r\n```json\r\n{\r\n \"scss\/bootstrap.css\": \"scss\/bootstrap-55a07f3bb1.css\"\r\n}\r\n```\r\n\r\nChanging the `base` option with `base: '.\/src\/sass'` the result is:\r\n```json\r\n{\r\n \"\/vagrant\/public\/scss\/bootstrap.css\": \"\/vagrant\/public\/scss\/bootstrap-55a07f3bb1.css\"\r\n}\r\n```\r\n\r\nIs there any option to follow the destination path (`gulp.dest()`) after `rev()` or changing the base folder?\r\n\r\nI don't want to install other plugins it in order to fix this behaviour.","issue_id":1660110394894,"origin_id":267147486,"user_origin_id":433819,"create_time":1481747401,"update_time":1481747401,"id":1663076116810,"updated_at":"2022-09-13T13:35:16.810000Z","created_at":"2022-09-13T13:35:16.810000Z"},{"_id":"632087141a26130c7b1eb136","body":"Also having a similar issue where we have multiple stand alone js files for different areas, for instance;\r\n\r\n`\/dashboards\/something\/some-feature.js`\r\n`\/admin\/something-else\/admin-feature.js`\r\n\r\nAnd they're all just getting written in the manifest to `something\/file.js` rather than the full path, which makes aliasing it impossible. I can't seem to find a nice way of making it keep the path i.e. the manifest looking like;\r\n\r\n```json\r\n{\r\n\"\/dashboards\/something\/some-feature.js\": \"\/dashboards\/something\/some-feature-89s8ad7f0ss7d.js\"\r\n}\r\n```\r\n\r\ninstead of what I get now (missing off dashboards from the path);\r\n\r\n```json\r\n{\r\n\"something\/some-feature.js\": \"some-feature-89s8ad7f0ss7d.js\"\r\n}\r\n```\r\n\r\nIf anyone has any work arounds for this atm that'd be really useful","issue_id":1660110394894,"origin_id":271850365,"user_origin_id":1255512,"create_time":1484135723,"update_time":1484135868,"id":1663076116814,"updated_at":"2022-09-13T13:35:16.814000Z","created_at":"2022-09-13T13:35:16.814000Z"},{"_id":"632087141a26130c7b1eb137","body":"@Dayjo same problem here, did you find a solution?","issue_id":1660110394894,"origin_id":337628554,"user_origin_id":570975,"create_time":1508340237,"update_time":1508340237,"id":1663076116819,"updated_at":"2022-09-13T13:35:16.818000Z","created_at":"2022-09-13T13:35:16.818000Z"},{"_id":"632087141a26130c7b1eb139","body":"After like 4 hours of searching I finally find fix, how to fix it\r\n\r\nBefore\r\n```\r\ngulp.task('sass', function() {\r\n return gulp.src([\"www\/css\/web.scss\"])\r\n .pipe(concat('web.css'))\r\n .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))\r\n .pipe(rev())\r\n .pipe(gulp.dest(\"www\/dist\/css\"))\r\n .pipe(rev.manifest({\r\n merge: true\r\n }))\r\n .pipe(gulp.dest(\"www\/dist\/css\"))\r\n .pipe(browserSync.stream());\r\n});\r\n```\r\nresults in\r\n```\r\n{\r\n \"web.css\": \"web-b70dd90d41.css\"\r\n}\r\n```\r\n\r\nnow\r\n```\r\ngulp.task('sass', function() {\r\n return gulp.src([\"www\/css\/web.scss\"])\r\n .pipe(concat('web.css'))\r\n .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))\r\n .pipe(rev())\r\n .pipe(gulp.dest(\"www\/dist\/css\"))\r\n .pipe(rename({\r\n dirname: \"dist\/css\" \/\/ rename dir in manifest\r\n }))\r\n .pipe(rev.manifest({\r\n merge: true\r\n }))\r\n .pipe(gulp.dest(\"www\/dist\/css\"))\r\n .pipe(browserSync.stream());\r\n});\r\n```\r\n\r\noutputs\r\n```\r\n{\r\n \"dist\/css\/web.css\": \"dist\/css\/web-b70dd90d41.css\"\r\n}\r\n```\r\n\r\n","issue_id":1660110394894,"origin_id":353687226,"user_origin_id":1005131,"create_time":1513983330,"update_time":1513983330,"id":1663076116824,"updated_at":"2022-09-13T13:35:16.824000Z","created_at":"2022-09-13T13:35:16.824000Z"},{"_id":"632087141a26130c7b1eb13a","body":">After like 4 hours of searching I finally find fix, how to fix it\r\n\r\nTell me about it, your solution worked for me also.\r\n\r\n","issue_id":1660110394894,"origin_id":402877603,"user_origin_id":9396189,"create_time":1530832093,"update_time":1530832093,"id":1663076116828,"updated_at":"2022-09-13T13:35:16.828000Z","created_at":"2022-09-13T13:35:16.828000Z"},{"_id":"632087141a26130c7b1eb13c","body":"> .pipe(rename({ dirname: \"dist\/css\" \/\/ rename dir in manifest }))\r\n\r\nThank you very much, worked for me","issue_id":1660110394894,"origin_id":429626290,"user_origin_id":24986517,"create_time":1539523524,"update_time":1539523524,"id":1663076116833,"updated_at":"2022-09-13T13:35:16.832000Z","created_at":"2022-09-13T13:35:16.832000Z"}] comment

Please consider this task: ``` gulp.task("sass-build", function() { return gulp.src(["source/sass/**/*.scss"]) .pipe(compass({ sass: "source/sass", })) .pipe(rev()) .pipe(gulp.dest("build/css")) .pipe(rev.manifest()) .pipe(gulp.dest("build/")); }); ``` In summary: **Source root** folder is `source/` **Build root** folder...

not work with gulp watch

[{"_id":"632087151a26130c7b1eb13d","body":"Still an issue?","issue_id":1660110394896,"origin_id":694102046,"user_origin_id":10898370,"create_time":1600333605,"update_time":1600333605,"id":1663076117161,"updated_at":"2022-09-13T13:35:17.161000Z","created_at":"2022-09-13T13:35:17.161000Z"}] comment

``` function js_files() { return src('./assets/scripts/*.js') .pipe(dest('./public/scripts')) .pipe(rev()) .pipe(dest('./public/scripts')) .pipe(rename({ dirname: "/scripts/" })) .pipe(rev.manifest('public/rev-manifest.json',{ merge: true, base: './public' })) .pipe(dest('./public/')) } function defaultTask(cb) { watch('./assets/scripts/*.js', {ignoreInitial: false}, js_files) } exports.default...

why the source has changed, but the hash no change?

[{"_id":"632087151a26130c7b1eb13e","body":"same problem, rev-manifest not changed unless rerun npx gulp","issue_id":1660110394898,"origin_id":528405249,"user_origin_id":3498786,"create_time":1567694732,"update_time":1567694732,"id":1663076117510,"updated_at":"2022-09-13T13:35:17.509000Z","created_at":"2022-09-13T13:35:17.509000Z"},{"_id":"632087151a26130c7b1eb13f","body":"Same here, I have to run it twice","issue_id":1660110394898,"origin_id":604433706,"user_origin_id":5049893,"create_time":1585229616,"update_time":1585229616,"id":1663076117514,"updated_at":"2022-09-13T13:35:17.513000Z","created_at":"2022-09-13T13:35:17.513000Z"},{"_id":"632087151a26130c7b1eb140","body":"Actually, it doesn't seem to be an issue with gulp-rev. Found out my postcss task wasn't finished by the time it reached `rev()`, so the first time no changes were detected. Fixed that and it all works.","issue_id":1660110394898,"origin_id":604461943,"user_origin_id":5049893,"create_time":1585232850,"update_time":1585232850,"id":1663076117517,"updated_at":"2022-09-13T13:35:17.516000Z","created_at":"2022-09-13T13:35:17.516000Z"},{"_id":"632087151a26130c7b1eb141","body":"I also ran into this problem and never found a gulp-rev based solution. I ended up using gulp-hash instead.","issue_id":1660110394898,"origin_id":611374041,"user_origin_id":49811,"create_time":1586416970,"update_time":1586416970,"id":1663076117520,"updated_at":"2022-09-13T13:35:17.520000Z","created_at":"2022-09-13T13:35:17.520000Z"}] comment

I have changed the source css code, and rebuild the task, but the hashed css name is the same as before.here is the code. ``` gulp.task('style', () => { var...

Option to override original files

[{"_id":"632087151a26130c7b1eb142","body":"Strange feature asked.\nBut keep in your mind one Gulp plugin = one feature\n\nAfter gulp-rev you can use gulp-rename and gulp.dest to move your files\n","issue_id":1660110394901,"origin_id":191095934,"user_origin_id":3020368,"create_time":1456901347,"update_time":1456901347,"id":1663076117920,"updated_at":"2022-09-13T13:35:17.920000Z","created_at":"2022-09-13T13:35:17.920000Z"},{"_id":"632087151a26130c7b1eb143","body":"Check out [`gulp-rev-delete-original`](https:\/\/www.npmjs.com\/package\/gulp-rev-delete-original).\n","issue_id":1660110394901,"origin_id":191113428,"user_origin_id":53660,"create_time":1456904457,"update_time":1456904457,"id":1663076117926,"updated_at":"2022-09-13T13:35:17.925000Z","created_at":"2022-09-13T13:35:17.925000Z"},{"_id":"632087151a26130c7b1eb144","body":"It's more like an option than a feature.\nThis plugin takes style.css and creates style.ab123.css.\nWhy not take an `{override:true}` option to replace the revisioned file?\nI can't think of any use case where one would like to keep both.\n\nI know about gulp-rev-delete-original, but it's easier to pass a flag than to add another dependency.\n","issue_id":1660110394901,"origin_id":191385338,"user_origin_id":699657,"create_time":1456946759,"update_time":1456946759,"id":1663076117929,"updated_at":"2022-09-13T13:35:17.929000Z","created_at":"2022-09-13T13:35:17.929000Z"},{"_id":"632087151a26130c7b1eb145","body":"> I can't think of any use case where one would like to keep both.\n\nI can't think of any use case where the first should be written to disk to begin with :)\n","issue_id":1660110394901,"origin_id":191386821,"user_origin_id":53660,"create_time":1456946898,"update_time":1456946898,"id":1663076117932,"updated_at":"2022-09-13T13:35:17.932000Z","created_at":"2022-09-13T13:35:17.932000Z"},{"_id":"632087151a26130c7b1eb146","body":"Ha, well I like to keep the rev tasks separate from the CSS, JS etc tasks so that it's like a component I can remove or replace easily.\n\nSo it would looke like:\n`'build-js'`, `'revision-js'`\nBuild writes to dist, revision reads from dist and writes again.\n\nThere's also gulp.watch and livereloading that don't play well with revisioning assets because they also update HTML files and that triggers a full reload instead of a local one - like for CSS files.\n","issue_id":1660110394901,"origin_id":191424491,"user_origin_id":699657,"create_time":1456951878,"update_time":1456951927,"id":1663076117934,"updated_at":"2022-09-13T13:35:17.934000Z","created_at":"2022-09-13T13:35:17.934000Z"},{"_id":"632087151a26130c7b1eb147","body":"That sounds like an interesting idea. Just to be sure, @Francisc you are suggesting that old files should be deleted when new ones are created?\r\n\r\nFor examples, you have a css file that is `rev`ised into `styles-123.css`. You make some changes and the css file is `rev`ised again, into `styles-456.css`.\r\n\r\nIn this situation, you would like to have an option to tell `gulp-rev` to delete `styles-123.css`, right?\r\n\r\nIt makes sense. We'd have to think about it and make sure it's not colliding with other aspects though.","issue_id":1660110394901,"origin_id":298346752,"user_origin_id":2291025,"create_time":1493650114,"update_time":1493650151,"id":1663076117939,"updated_at":"2022-09-13T13:35:17.938000Z","created_at":"2022-09-13T13:35:17.938000Z"},{"_id":"632087151a26130c7b1eb149","body":"gulp-rev \u662f\u5982\u4f55\u77e5\u9053\u6211\u4fee\u6539\u4e86\u54ea\u4e9b\u6587\u4ef6\u7684\uff1f\u539f\u7406\u662f\u4ec0\u4e48\uff1f\u770b\u5b8c\u6e90\u7801\uff0c\u6ca1\u770b\u61c2\u3002\u3002\u3002 \u6bcf\u4e00\u6b21\u6784\u5efa gulp-rev\u662f\u5982\u4f55\u77e5\u9053 \u6211\u4e0a\u4e00\u6b21\u6784\u5efa\u72b6\u6001\u7684\uff0c\u6211\u6784\u5efa\u7684\u65f6\u5019\uff0c\u5df2\u7ecf\u52a0\u5165\u4e86\u5f88\u591a\u4ee3\u7801","issue_id":1660110394901,"origin_id":532563246,"user_origin_id":21070089,"create_time":1568792703,"update_time":1568792703,"id":1663076117947,"updated_at":"2022-09-13T13:35:17.947000Z","created_at":"2022-09-13T13:35:17.947000Z"}] comment

Hi, Is there a way (or future plans) to provide an option to gulp-rev asking it to rename / replace the original files instead of preserving them and creating new...

Discussion

Hello Just a question. I want a manifest like following: { "assets": { "general": { "js": [ "/assets/js/min/scripts.512bbf3f.min.js" ], "css": [ "/assets/css/style.686ae088.min.css" ] }, "above_the_fold": { "css": [ "/assets/css/above-the-fold.cb078d55.min.css" ],...

### Description The manifest.json file being merged with, is containing the correct hash of the compiled SCSS. Manifest.json is updated (according to filemtime) but not with the correct rev. Is...

Issue in rev-manifest.json file path

[{"_id":"632087161a26130c7b1eb14a","body":"Same issue here.\r\n\r\nDependencies:\r\n\r\n`\"gulp-rev\": \"^9.0.0\",\r\n\"gulp\": \"^4.0.0\",`\r\n\r\nExample task:\r\n\r\n const postcssPlugins = [\r\n autoprefixer({\r\n browsers: ['last 2 versions', 'ie 11']\r\n })\r\n ];\r\n\r\n const minifiedFileExtension = rename({\r\n extname: '.min.css'\r\n });\r\n\r\n if (options.prod) {\r\n postcssPlugins.push(cssnano);\r\n }\r\n\r\n gulp.src(config.paths.css.src)\r\n .pipe(plumber())\r\n .pipe(rev())\r\n .pipe(sourcemaps.init())\r\n .pipe(sass().on('error', sass.logError))\r\n .pipe(postCss(postcssPlugins))\r\n .pipe(gulpIf(options.prod, minifiedFileExtension))\r\n .pipe(sourcemaps.write())\r\n .pipe(gulp.dest(config.paths.css.dest))\r\n .pipe(\r\n browserSync.reload({\r\n stream: true\r\n })\r\n )\r\n .pipe(\r\n rev.manifest('manifest.json', {\r\n cwd: 'web\/app\/dist',\r\n merge: true\r\n })\r\n )\r\n .pipe(gulp.dest('web\/app\/dist'));","issue_id":1660110394906,"origin_id":436313238,"user_origin_id":5455451,"create_time":1541521217,"update_time":1541521230,"id":1663076118284,"updated_at":"2022-09-13T13:35:18.284000Z","created_at":"2022-09-13T13:35:18.284000Z"},{"_id":"632087161a26130c7b1eb14b","body":"To follow up, it seems that if a manifest.json already exists then the manifest is merged and placed where expected, in this case `web\/app\/dist`. If a manifest.json does not exist then the manifest is placed in the root which Im guess is process.cwd() in my case.","issue_id":1660110394906,"origin_id":436331108,"user_origin_id":5455451,"create_time":1541524105,"update_time":1541524105,"id":1663076118287,"updated_at":"2022-09-13T13:35:18.287000Z","created_at":"2022-09-13T13:35:18.287000Z"},{"_id":"632087161a26130c7b1eb14c","body":"Looks like using `path` solves this for me \ud83e\udd14\r\n\r\n`rev.manifest('manifest.json', {\r\n path: 'web\/app\/dist',\r\n merge: true\r\n })`","issue_id":1660110394906,"origin_id":436335888,"user_origin_id":5455451,"create_time":1541524946,"update_time":1541524946,"id":1663076118289,"updated_at":"2022-09-13T13:35:18.289000Z","created_at":"2022-09-13T13:35:18.289000Z"},{"_id":"632087161a26130c7b1eb14d","body":"@iamjaredwalters I already solved this issue but thanks for the answer. Can you tell me one more thing is there any way to keep track of all files in rev-mainfest.json? Right now if we make change in js file and execute gulp command then it overrides the file name in rev-mainfest.json but I want to keep track of all files like:\r\n```\r\n{\r\n\"module-min.js\": \"module-min-a2720m2695.js\",\r\n\"module-min.js\": \"module-min-asdasj2j3j3.js\",\r\n\"module-min.js\": \"module-min-adskj2n311.js\",\r\n....\r\n}\r\n```","issue_id":1660110394906,"origin_id":437330000,"user_origin_id":39403304,"create_time":1541762219,"update_time":1541762219,"id":1663076118296,"updated_at":"2022-09-13T13:35:18.295000Z","created_at":"2022-09-13T13:35:18.295000Z"}] comment

I am using gulp-rev and it is working fine. But I have one issue. I have multiple gulp task and I want to keep track of all in rev-mainfest.json file...