D
D
Dmitry Sergeevich2015-10-25 21:54:00
Web development
Dmitry Sergeevich, 2015-10-25 21:54:00

How to properly organize gulpfile.js?

Hello! My gulpfile.js has grown to an incredible size:

  • 25 dependencies galp
  • 300 lines of variables with parameters
  • 12 tasks that I use every day at work and a couple more just in case

And I started having problems:
  1. Dependencies are not installed the first time ($ npm i have to run 2-3 times)
  2. Super big 600 line noodles
  3. Most of the tasks I need only when building the project, and I have to put all the dependencies

Who can suggest ways to solve these problems?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
littleguga, 2015-10-25
@littleguga

Try to include gulp-tasks from the directory and split everything into separate files accordingly (for each task).
+ you can use npm link

A
Alex, 2015-10-25
@isqua

How to properly organize gulpfile.js? Like this: https://blog.simpleblend.net/gulp-organization-str...
The build dependencies are written in the package.json devDependencies section. So, to install dependencies, excluding those that are registered in devDependecies, use the command npm install --production.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question