leny / kouto-swiss

A complete CSS framework for Stylus
http://leny.me/kouto-swiss/
MIT License
377 stars 34 forks source link

Error when call kouto through gulp-load-plugins #57

Closed M-O-Z-G closed 9 years ago

M-O-Z-G commented 9 years ago
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import browserSync from 'browser-sync';
import del from 'del';
import {stream as wiredep} from 'wiredep';

const $ = gulpLoadPlugins({
  rename: {
    'gulp-stylus': 'stylus',
    'kouto-swiss': 'koutoSwiss',
    'gulp-notify': 'notify',
    'gulp-util': 'gutil'
  }
});
const reload = browserSync.reload;

...

gulp.task('styles', () => {
  return gulp.src('app/styles/*.styl')
    .pipe($.plumber())
    .pipe($.sourcemaps.init())
    .pipe( $.stylus({
      use: [$.koutoSwiss()]
    }) )
    .on('error', reportError )
    .pipe($.autoprefixer({browsers: ['last 1 version']}))
    .pipe($.sourcemaps.write())
    .pipe(gulp.dest('.tmp/styles'))
    .pipe(reload({stream: true}));
});

After run task get error:

 TypeError: undefined is not a function
    at Gulp.<anonymous> (X:/XXXXX/gulpfile.babel.js:55:15)
    at module.exports (X:\XXXXX\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (X:\XXXXX\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (X:\XXXXX\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (X:\XXXXX\node_modules\gulp\node_modules\orchestrator\index.js:134:8)
    at C:\Users\Master User\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3

In a typical call kouto via require, it's works.

leny commented 9 years ago

Hi,

Thanks for the report... I don't really know the gulp-load-plugins you mention, but its description say that it's a module to load gulp-plugins, which kouto-swiss isn't.

I don't really have time to dig through the code of gulp-load-plugins for now, but, as it, it's not really a bug.

M-O-Z-G commented 9 years ago

Yeah, I met with it the first time too. OK, it is not critical, of course.