gil / gulp-include-source

Include scripts and styles into your HTML files automatically.
MIT License
23 stars 12 forks source link

Nothing output #1

Open AidanNichol opened 10 years ago

AidanNichol commented 10 years ago

There is a problem which can result in nothing being added to the output html file.

I dug around a bit and the solution seems to be to include an option to specify the location of the javascript files that are to be included.

The current code assumes that the js/css files are located relative to the input file but that doesn't work once you start to do thing like build it with jade e.g.

gulp.src('./src/jade/*.jade')
.pipe(jade())
.pipe(includeSource())
.pipe(gulp.dest('./app'));

It is looking in ./src/jade for my scripts and I need a way to tell it to look in ./app or maybe ./src/js

gil commented 10 years ago

Hi @AidanNichol ! Sorry I didn't give an answer about that. I was on vacation and now things are really crazy at work, but I'll take a look as soon as possible :]

gil commented 10 years ago

Hi @AidanNichol , sorry it took so long to give you an answer. Could you please try version 0.0.5 with the following code:

gulp.src('src/jade/*.jade')
  .pipe(jade())
  .pipe(includeSource({ cwd : 'app/' }))
  .pipe(gulp.dest('app/'));
codeorganic commented 9 years ago

This issue can be closed.

I tested what @gil suggested and it works just fine