How to properly use gulp-vulcanize

1k Views Asked by At

I can't use gulp-vulcanize in my side project. I've followed the example but nothing seems to happen, there are also no errors in the console.

Here is my folder structure:

build/
  - html/
  - css/
  - js/
source/
  - html/
  - css/
  - js/
bower.json
gulpfile.coffee
gulpfile.js
package.json

Here is the gulp task I'm using

gulp.task 'vulcanize',
  ->
    gulp.src 'index.html'
      .pipe plumber()
      .pipe vulcanize {
        abspath: ''
        excludes: []
        stripExcludes: false
      }
      .pipe gulp.dest 'vulcanized'

I'm using the following for vulcanizing my html files:

  • gulp - 3.9.0
  • gulp-vulcanize - 6.1.0
  • gul-crisper - 1.0.0
1

There are 1 best solutions below

2
On

There is no index.html file in the same directory as your gulpfile. So nothing can happen. Give it the proper path :

gulp.task 'vulcanize', ->
    gulp.src 'build/html/index.html'
        .pipe vulcanize()
        .pipe gulp.dest 'vulcanized'

Don't pass any option to vulcanuze(), as you're just passing its defaults, so it's useless.

BTW, Gulp accepts coffee files, you don't have to compile your gulpfile.coffee into gulpfile.js. Just go :

npm install -g coffee-script

gulp

> using gulpfile.coffee