M
M
Maxim2015-04-20 20:29:12
JavaScript
Maxim, 2015-04-20 20:29:12

How to make a global variable in gulpjs?

I split tasks into files. You need a global object to store the configuration.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Shatokhin, 2015-04-20
Antonikhin @STJ

You can create a module (let's call it "global-for-gulp" for example) in which you will store the object.

var storage = {};
module.exporst = storage;

And in each task to request it:
var gObj = require("global-for-gulp");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question