How can I use Gulp-Stylus, Jeet and rupture with Gulp-load-plugins

Asked

Viewed 151 times

1

If I use Stylus with Jeet and Rupture, my gulpfile.js would look like this:


    .pipe(stylus({  
        use:[prefixer(), jeet(), rupture()],  
        compress: true  
    }))

Now, I modularized my Gulp tasks with Gulp-load-plugins. And then I left:


    .pipe(plugins.stylus({  
        use:[prefixer(), jeet()],  
        compress: true  
    }))

However, when calling Gulp in the terminal, it is a mistake. It says that Jeet is not a Function


[14:17:09] Starting 'stylus'...  
[14:17:09] 'stylus' errored after 466 ms  
[14:17:09] ReferenceError: jeet is not defined  
at Gulp. (/home/ednilson/Projects/web/workflow/workflow-stylus/tasks/stylus.js:6:22)  
at module.exports (/home/ednilson/Projects/web/workflow/workflow-stylus/node_modules/orchestrator/lib/runTask.js:34:7)  
at Gulp.Orchestrator._runTask (/home/ednilson/Projects/web/workflow/workflow-stylus/node_modules/orchestrator/index.js:273:3)  
at Gulp.Orchestrator._runStep (/home/ednilson/Projects/web/workflow/workflow-stylus/node_modules/orchestrator/index.js:214:10)  
at Gulp.Orchestrator.start (/home/ednilson/Projects/web/workflow/workflow-stylus/node_modules/orchestrator/index.js:134:8)  
at /home/ednilson/Projects/web/workflow/workflow-stylus/tasks/watch.js:6:17  
at write (/home/ednilson/Projects/web/workflow/workflow-stylus/node_modules/gulp-watch/index.js:123:9)  
at /home/ednilson/Projects/web/workflow/workflow-stylus/node_modules/vinyl-file/index.js:52:4  
at /home/ednilson/Projects/web/workflow/workflow-stylus/node_modules/graceful-fs/graceful-fs.js:78:16  
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:404:3)  

I tried to declare again by following the Gulp-load-plugins documentation guidance:


    plugins.prefixer = require('autoprefixer-stylus');  
    plugins.jeet = require('jeet');

It didn’t work out. So I tried to call right into the task:


    .pipe(plugins.stylus({  
    use:[plugins.prefixer(), plugins.jeet()],  
    compress: true  
    }))


    .pipe(plugins.stylus({  
        use:[plugins.prefixer(), plugins.jeet()],  
        compress: true  
    }))

How could I fix this?

Thank you all! :)

  • 2

    Hi Ednilson, can you translate the question to English?

  • 2

    Yes, of course. translating..

  • 1

    Syntax wouldn’t be something like import: ['jeet/stylus/jeet', ...? I don’t know this plugin mto well, I use Stylus directly as Middleware on Node...

  • So in Gulp I just use calling the pipe and use[Jeet(), rupture()]. Then in main.styl only @import "Jeet".

  • You are using the latest versions of these modules?

  • Yes, the latest versions of everything..

  • I solved it. I called them individually within the task Stylus.js.. with const Jeet = require('Jeet'), Then he was good.. thanks anyway :)

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.