postor / gulp-jade-for-php

针对php语言的jade模板实现,利用gulp进行前端自动化| a gulp plugin for jade template adapt for php
0 stars 1 forks source link

Error in the console, requires basedir, but wouldn't take the parameter #3

Open programmatio opened 9 years ago

programmatio commented 9 years ago

I'm Getting this error in Gulp

/Users/SomeUser/Project/node_modules/gulp-jade-for-php/node_modules/jade/lib/runtime.js:231 throw err; ^ Error: Jade:8 6| .page-container 7| .wrapper

8| include /Users/SomeUser/Project/views/mixins/menu.jade 9| .page 10| 11| .scrollable-section

the "basedir" option is required to use "include" with "absolute" paths

Tried to do this


    # Build PHP

    gulp.task 'php', ->
        jade = require 'gulp-jade-for-php'
        gulp.src 'views/**/*.jade', { basedir: 'views'}
            .pipe jade          
              pretty: true
              basedir: "/Users/SomeUser/Project/views"
            .pipe gulp.dest 'public'
postor commented 9 years ago

now i compile each jade file to a php file, use php framework or require/include to join pieces up. may be i need to add an option for jade, but i`m not sure yet

aspanoz commented 8 years ago

option for jade it is sounds as a good idea. at least 'pretty'! It is no pretty, it's compressed by default ( It's seems doesn't work:

gulp.task('jade', function(){
  var stream = gulp
    .src([ '/home/user/workspace/**/*.jade' ])
    .pipe(cache('jade'))
    .pipe(plumber({ errorHandler: reportError }))
    .pipe(jade({ "pretty": true }))
    .pipe(plumber.stop())
    .pipe(rename('.phtml'))
    .pipe(gulp.dest('../some/path/'));

  return stream
     .pipe(notify({ 
        "title":'JADE',
        "message": 'Successfully compiled',
        "subtitle": "Project web site",
        "onLast": true,
      }));
});