A
A
Alexander Ufik2017-07-07 01:44:11
Building projects
Alexander Ufik, 2017-07-07 01:44:11

How to reuse gulpfile.js?

Good day to all! Not so long ago I started using Gulp, and I ran into this problem: I don’t understand how to reuse package.json, this is how it is described in one of the guides:

The package.json file is the manifest file of our project, which describes, in addition to the information that we entered in the terminal, also information about the packages used in our project.
For example, if we install Gulp into the project with the --save-dev key, then the package and version used will automatically be added to our package.json. This accounting will allow you to quickly deploy a new project using the existing package.json and install the necessary modules with dependencies that are specified in package.json in new projects.

That is, do not register the connection of the desired plugin in the console for each project, etc. (I confess, until that time I had done so), but unfortunately it does not indicate exactly how to do this, as in all the manuals that I read. I've been interested in this business not so long ago, so don't scold too much, and if I misunderstood something, then please explain how to get away from this "prescribing to the console for each project"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yunus Gaziev, 2017-07-07
@Ufiik

dependencies / plugins must be specified in package.jsonthe keys dependenciesor devDependencies, if they are not there, then the dependencies / plugins must be installed as indicated in the manual with the flags --save --save-devor --save --save-exact, and then just copy gulpfile.js and package.json to a new project and execute the command in it npm install(as said in the answer above)

Z
zooks, 2017-07-07
@zooks

Use package.json with this content:
Then just runnpm install

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question