ragingwind / gulp-crisper

gulp plugin for crisper
18 stars 11 forks source link

Generate the output js file at the specified path, if a jsFileName is specified in options. #12

Closed singhsays closed 8 years ago

singhsays commented 8 years ago

Currently, with a jsFileName specified in options to crisper, the correct relative path is inserted in the crisp'd html file but the the js file is still generated at the default path. e.g

 return gulp.src('app/index.html')
  .pipe(vulcanize({
    inlineScripts: true,
    inlineCss: true,
    stripComments: true
  }))
  .pipe(polyclean.uglifyJs())
  .pipe(crisper({
    jsFileName: "static/js/index.js"
  }))
  .pipe(gulp.dest('dist'));

creates

$ ls -R dist
index.html index.js

This patch makes it such that the generated js file is written to the path as specified in jsFileName. e.g.

$ ls -R dist
index.html static

dist/static:
js

dist/static/js:
index.js
ragingwind commented 8 years ago

Thanks for PR but I recommend you to use gulp-rename instead of. refer to https://github.com/ragingwind/gulp-crisper/issues/10 This is a gulp plugin for crisper's APIs and we already have a solution for redirecting of path of the stream