E
E
elailasou2014-12-12 16:46:12
JavaScript
elailasou, 2014-12-12 16:46:12

Grunt and file problem (thousands of them). What to do?

I use Grunt for several projects (more than 10). In each project, plugins are installed locally in the node_modules folder. Each such folder contains a LOT of files (100-300 thousand), which makes it difficult to copy the project folder, backup, synchronize, and so on. Is there a way to install plugins globally or it goes against their principles. How are things with this in Gulp?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Nalomenko, 2014-12-12
@junk1114

Well, in general, only the working files of the project are usually copied, without the node_modules folder (in particular, when working with git repositories, folders of this kind are marked as git-ignore). That is, in fact, you only need to store package.json , which stores information about all the necessary modules. After migrating the project, another developer will just have to issue the console command npm install, and Node.js will install all the necessary modules.
PS: Yes, in gulp.js everything is about the same.

A
Arthur, 2015-03-26
Mudrick @mudrick

I use Grunt for N projects, but I have only one node_modules folder (there are a couple of tens of thousands of files), it just lies on drive D, and all projects simply link to this folder (I make junction with the HardLinkShellExt utility - it creates links to folders).
Tobish, on drive D there is a node_modules folder with a bunch of modules and tens of thousands of files, and in each project there is a folder called node_modules , but it is empty and not a folder at all, but a link to that main folder.
The only thing is that I always have all the Ground modules of the same versions in the package.json config - there is no such thing that in one project I need a certain Ground module of one version, and in another project I need the same module of a different version.

P
Philipp, 2014-12-12
@zoonman

I don't know how it is in Grunt, but in Gulp it's all modules from Node.js. You declare all dependencies in package.json and simply exclude node_modules from backups. npm install is part of the deployment process and there is no point in synchronizing unnecessary parts of the project. In addition, I can recommend something like a continuous integration process. In general, it is ideal to store the VCS project code , and user data in a separate place.
This is how it is done in the right projects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question