shonny-ua / gulp-rev-collector

Static asset revision data collector from manifests, with was generated from different streams and replace they's links in html template.
MIT License
150 stars 41 forks source link

whitout suffix file cannot work well #55

Closed 809662683 closed 5 years ago

809662683 commented 5 years ago

my rev-manifest.json file content like { "js/act_create_task_add": "js/act_create_task_add-d5b3871a7a", "js/act_create_task_icon_list": "js/act_create_task_icon_list-0214817f5d", "js/act_create_task_list": "js/act_create_task_list-43930d8cf8", "js/act_history_list": "js/act_history_list-d7d8e12548", {

my html file content

gulp.js gulp.task('revFile',function(){ return gulp.src(['target/portalUI/*.json','src/**/page/**/*.html']) .pipe(revCollector({replaceReved: true,dirReplacements:{}})) .pipe(gulp.dest('target/portalUI')); }) after run this task , html file content not changed. why ? thanks !

shonny-ua commented 5 years ago

"js/act_create_task_add": "js/act_create_task_add-d5b3871a7a", does you not use the .js extension?

809662683 commented 5 years ago

yes, because i use requirejs framework , https://requirejs.org/ for example: https://github.com/requirejs/example-multipage/blob/master/www/page1.html

<script data-main="js/page1" src="js/lib/require.js"></script> image

shonny-ua commented 5 years ago

I wrote some test. In this test , html file content is changed. I detect wrong behavior using replaceReved: true in your without extensions case. But without replaceReved param all works correctly.

809662683 commented 5 years ago

thanks a lot , I solved my problem, i found my project some file name like this: "js/course_teacher_query.min": "js/course_teacher_query-d8208947a9" this is make the plugin not work.... after delete it, problem is gone. thank you very much!