Javascript 如何正确使用大口硫化胶

Javascript 如何正确使用大口硫化胶,javascript,build,gulp,vulcanize,Javascript,Build,Gulp,Vulcanize,我不能在我的辅助项目中使用gulp硫化胶。 我遵循了这个示例,但似乎什么也没有发生,控制台中也没有错误 以下是我的文件夹结构: 构建/ -html/ -css/ -js/ 来源/ -html/ -css/ -js/ bower.json gulpfile.coffee gulpfile.js package.json 这是我正在使用的吞咽任务 gulp.task 'vulcanize', -> gulp.src 'index.html' .pipe plumber(

我不能在我的辅助项目中使用gulp硫化胶。 我遵循了这个示例,但似乎什么也没有发生,控制台中也没有错误

以下是我的文件夹结构:

构建/
-html/
-css/
-js/
来源/
-html/
-css/
-js/
bower.json
gulpfile.coffee
gulpfile.js
package.json

这是我正在使用的吞咽任务

gulp.task 'vulcanize',
  ->
    gulp.src 'index.html'
      .pipe plumber()
      .pipe vulcanize {
        abspath: ''
        excludes: []
        stripExcludes: false
      }
      .pipe gulp.dest 'vulcanized'
我使用以下方法硫化我的html文件:

  • 大口喝-3.9.0
  • 大口硫化-6.1.0
  • 古尔脆饼-1.0.0

与您的
gulpfile
在同一目录中没有
index.html
文件。所以什么也不会发生。给它正确的路径:

gulp.task 'vulcanize', ->
    gulp.src 'build/html/index.html'
        .pipe vulcanize()
        .pipe gulp.dest 'vulcanized'
不要将任何选项传递给vulcanuze(),因为您只是传递它的默认值,所以它是无用的

顺便说一句,Gulp接受coffee文件,您不必将
gulpfile.coffee
编译成
gulpfile.js
。走吧:

npm install -g coffee-script

gulp

> using gulpfile.coffee

我已将gulp.src更改为“build/html/index.html”,并删除了选项,但我仍然得到相同的结果。现在,问题是index.html导入的文件的路径,感谢您的帮助和提示