0

I have a file (index.html) in my app/ folder in a project. It contains a <base href="/"> tag as well as some imports from app/bower_components/. As part of my distribution process, I use Gulp to move the code from app/ to dist/, and then run vulcanize on it via polybuild. index.html makes it into the dist/ directory, as does bower_components/, but when vulcanize gets it, it tries to open the first import:

<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>

Instead of looking in dist/bower_components/… (or just bower_components/…, relative to the dist/index.html file), however, it looks for /.index.html/bower_components/…. How do I stop it from using this and use the relative URL as written in the original code? Commenting out the <base> tag solves the issue.

Gulp Task (from Polymer Starter Kit):

gulp.task('vulcanize', function () {
  return gulp.src('dist/index.html')
  .pipe(polybuild({maximumCrush: true}))
  .pipe(gulp.dest('dist/'));
});
RedBassett
  • 3,469
  • 3
  • 32
  • 56
  • cant comment unless I see your gulp setup – harishr Dec 18 '15 at 04:29
  • Gulp task added. Note that the use of the command line vulcanize command returns the original HTML file, with the link written as `../../../../../.index.html/bower_components/webcomponentsjs/webcomponents.min.js`. It is treating `` as `/` on the filesystem. – RedBassett Dec 18 '15 at 19:18

0 Answers0