Reputation: 11766
I've been using Gulp for quite a while and either I didn't notice it took this much space from the beginning or the sizes have been growing.
I only use it for very normal front-end work. For example, this is the request part of my gulpfile.js
:
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
browserSync = require('browser-sync'),
concat = require('gulp-concat'),
copy = require('gulp-copy'),
del = require('del'),
htmlmin = require('gulp-htmlmin'),
merge = require('merge-stream'),
streamqueue = require('streamqueue'),
cleancss = require('gulp-clean-css'),
gulpif = require('gulp-if'),
newer = require('gulp-newer'),
imgmin = require('gulp-imagemin'),
plumber = require('gulp-plumber'),
postcss = require('gulp-postcss'),
order = require('gulp-order'),
rename = require('gulp-rename'),
runSequence = require('run-sequence'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify'),
uncss = require('gulp-uncss');
Now, according to du -sh
, node_modules weighs 2.2GB which I think is way too much. I wanted to dig a bit deeper so I looked all root modules:
I'm probably being naive here but I'm just expecting some javascript functionality, I don't see how or why these modules, especially the top ones, can be so large in size.
Is this just how Gulp is designed? Am I doing it backwards? Can I improve this (besides not using it/those)?
Upvotes: 25
Views: 18209
Reputation: 788
There are some ways that comes to my mind:
It's more about your package.json, so if you could optimize it, it's a very good option:
–production
flag on npm install).Use node-prune or modclean or other packages like these, to remove unnecessary files from node_modules.
Upvotes: 5