Closed gaarf closed 9 years ago
gulp-vulcanize does not seem to pick up the abspath option. It works fine when using vulcanize directly on command line.
abspath
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:
all-imports.html
<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">
Same answer as https://github.com/sindresorhus/gulp-vulcanize/issues/27#issuecomment-110118652. This plugin just passes everything to vulcanize, open an issue there.
https://github.com/Polymer/vulcanize/issues/203
gulp-vulcanize does not seem to pick up the
abspath
option. It works fine when using vulcanize directly on command line.all-imports.html
contains both relative and absolute imports. Eg: