ladjs / gulp-jade-usemin

Gulp plugin for running usemin on Jade files
MIT License
21 stars 15 forks source link

1.0.2 changes the outputRelativePath #20

Open devinmcinnis opened 9 years ago

devinmcinnis commented 9 years ago

Sorry I don't have a whole lot of time to debug this right now but since the update to 1.0.2, my staging server hasn't been able to compile properly in the last 3 pushes. For now, I've had to revert to 1.0.0.

      gulp.src(['./views/**/*.jade'])
        .pipe(plugin.plumber())
        .pipe(plugin.jadeUsemin({
          assetsDir: './built',
          path: './built',
          outputRelativePath: '../../public/',
          js: [plugin.uglify({
            mangle: true
          }), plugin.revAll()],
          css: [plugin.revAll()]
        }))
        .pipe(gulp.dest('./built/views'));

views/layout.jade (base view file)

include partials/mixins

html
  head
  body

views/partials/mixins.jade

//- ============================================
//-
//-      1# Main black menu
//-      2# Terms & Privacy copy
//-      3# Bookmark change state mixin
//-      4# meta tags for media objects inside cards

After running through gulp-jade-usemin@1.0.2:

built/views/partials/mixins.jade

/Users/###/###/###/built/bower_components/jquery.cookie/jquery.cookie.js/- ============================================
//-
//-      1# Main black menu
//-      2# Terms & Privacy copy
//-      3# Bookmark change state mixin
//-      4# meta tags for media objects inside cards

I'm also noticing that the output paths are to src="/public/css/main.css" rather than src="/css/main.css".

If I had to guess, it would be something to do with this commit since that's the only thing I can see since 1.0.0 dealing with outputRelativePath.

deltasquare4 commented 9 years ago

I am having the same issue and switching to 1.0.0 works for now. I will try to find time and submit a patch.

deltasquare4 commented 9 years ago

I ended up using gulp-usemin with html files specifically for usemin. Turns out, you can include html files inside jade just like jade files.

@gdi2290 If you're not going to maintain it, maybe change the description to point to gulp-usemin instead, so that people don't spend too much time on this one?