Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

relative paths don't resolve correctly in sub directories #19

@ellvtr

Description

@ellvtr

When using relative paths in html documents in sub directories, it doesn't resolve correctly. Change the path to an absolute path and it works again. Error looks like this where doc root is www/ from gulpfile position:

$ gulp
[14:32:12] Using gulpfile ~/.../gulpfile.js
[14:32:12] Starting 'cachebust'...
fs.js:641
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/.../www/assets/js/main.js'

The correct path here would've been /.../www/cv/assets/js/main.js as it was referenced from an html doc in the www/cv/ dir with <script type="text/javascript" src="assets/js/main.js"></script>. Browsers resolve that correctly.

gulpfile looks like this:

gulp.task('cachebust', function(){
  return gulp.src('./www/**/*.html')
    .pipe(cachebust({
      type: 'MD5'
    }))
    .pipe(gulp.dest('./www'));
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions