zhangaz1/gulp-rev-orig

Multiple CDN script includes will fail the build with 'not found' error

Opened this issue · 0 comments

dmg3 commented

If you import more than 1 script from a CDN, rev will fail on the 2nd one.

Sample html:

<script src="main.js"></script>
<script src="https://apis.google.com/js/platform.js"></script>
<script src="https://apis.google.com/js/platform2.js"></script>

Running rev against it will get a '/home/platform2.js not found error'. This seems to be triggered by the fact that there are multiple imports in a row. If I add a script import for a local file between those 2 lines, then the file will process fine:

<script src="main.js"></script>
<script src="https://apis.google.com/js/platform.js"></script>
<script src="main.js"></script>
<script src="https://apis.google.com/js/platform2.js"></script>

as will this (note multiple local files in this example):

<script src="main.js"></script>
<script src="main.js"></script>
<script src="https://apis.google.com/js/platform2.js"></script>

My task is barebones:

gulp.task('client.postprocess_html:dist', () => {
  return gulp.src('./client/dist/*.html')
    .pipe(rev())
    .pipe(gulp.dest('./client/dist/'));
});