Skip to content

gulp-vulcanize doesnt seem to make use of abspath option #1783

@gaarf

Description

@gaarf

gulp-vulcanize does not seem to pick up the abspath option. It works fine when using vulcanize directly on command line.

gulp.task('vulcanize', ['html:elements'], function (done) {

  /**
   * gulp-vulcanize does not work as expected!
   */

  // return gulp.src('./dist/assets/elements/x-app/all-imports.html')
  //   .pipe(plug.vulcanize({
  //     abspath: __dirname
  //   }))
  //   .pipe(plug.concat('x-app.vulcanized.html'))
  //   .pipe(gulp.dest('./dist/assets/bundle'));


  /**
   * same thing using command-line does work
   */

  var output = [],
      child = spawn(
        './node_modules/gulp-vulcanize/node_modules/.bin/vulcanize',
        [ '--abspath', '.', 'dist/assets/elements/x-app/all-imports.html' ],
        { cwd: __dirname }
      );

  child.stdout.on('data', function (b) {
    output.push(b);
  });

  child.on('close', function() {
    var filename = __dirname + '/dist/assets/bundle/x-app.vulcanized.html';
    mkdirp(path.dirname(filename), function() {
      fs.writeFile(filename, Buffer.concat(output), done);
    });
  });

});

all-imports.html contains both relative and absolute imports. Eg:

<link rel="import" href="./x-app.html">
<link rel="import" href="/bower_components/paper-styles/paper-styles.html">
<link rel="import" href="../lorem-ipsum/lorem-ipsum.html">

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions