sindresorhus / gulp-vulcanize

Concatenate a set of Web Components into one file
MIT License
100 stars 25 forks source link

Not possible to vulcanize from a stream #40

Closed panuhorsmalahti closed 7 years ago

panuhorsmalahti commented 8 years ago

It would be useful (and be according to gulp best practices) if gulp-vulcanize could be supplied the target.html file and all the files required for vulcanization (the target.html would need to be specified as an option to gulp-vulcanize or vulcanize). As far as I understand, vulcanize itself will read the files it needs from the hard drive, so this feature might need some support from vulcanize too.

The task would then look like this:

gulp.task('default', () =>
    gulp.src('src/**/*')
        .pipe(vulcanize({
            target: 'src/index.html',
            abspath: '',
            excludes: [],
            stripExcludes: false
        }))
        .pipe(gulp.dest('dest'))
);

As it stands I need to compile all my .pug files to .html, my TypeScript files to .js, write them to the hard drive, vulcanize the files and then delete the extra files. This use of I/O causes a slower build time etc.

sindresorhus commented 7 years ago

As you said, this would need to be added to Vulcanize first.

sindresorhus commented 7 years ago

Open an issue/PR on Vulcanize and comment the link here.