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! :)
Hi Ednilson, can you translate the question to English?
– Sergio
Yes, of course. translating..
– Ednilson Amaral
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...– Sergio
So in Gulp I just use calling the pipe and use[Jeet(), rupture()]. Then in main.styl only @import "Jeet".
– Ednilson Amaral
You are using the latest versions of these modules?
– Sergio
Yes, the latest versions of everything..
– Ednilson Amaral
I solved it. I called them individually within the task Stylus.js.. with const Jeet = require('Jeet'), Then he was good.. thanks anyway :)
– Ednilson Amaral