dshemendiuk / gulp-npm-dist

Copy minified (dist) files of modules listed in package.json "dependencies" field to your build path
26 stars 3 forks source link

lot of time #6

Open mariodeci opened 6 years ago

mariodeci commented 6 years ago

Thanks for your work. I noticed it spent a lot of time trying to find dependecies: gulp.task('copy:npmdep', function () { return gulp.src(npmDist({ copyUnminified: true, excludes: [ '/test//*', '//Gruntfile.js', '//gulpfile.js', '//package.json', '//package-lock.json', '//bower.json', '//composer.json', '//yarn.lock', '//webpack.config.js', '/*/README', '//LICENSE*', '//CHANGELOG*', '/*/.yml', '//*.md', '//*.coffee', '/*/.ts', '//*.scss', '/*/.less' ], replaceDefaultExcludes: true }), {base: 'node_modules'}) //.pipe(changed('build/node_modules')) .pipe(gulp.dest('build/node_modules')); });

On a Linux: [17:35:55] Starting 'copy:npmdep'... [17:37:37] Finished 'copy:npmdep' after 1.68 min

On Windows: [17:42:15] Starting 'copy:npmdep'... [17:44:34] Finished 'copy:npmdep' after 2.32 min

How-to speed it up?

Thanks

dshemendiuk commented 6 years ago

Hi, @mariodeci This is quite strange. In my projects (up to 20 dependencies) the task takes about 30-60 ms Can you show your package.json?

mariodeci commented 6 years ago

sure, that's it:

{ "name": "myAPP", "version": "1.0.0", "scripts": { "lite": "lite-server", "tsc": "tsc", "tsc:w": "tsc -w", "typings": "typings", "clean": "gulp clean", "compile": "gulp compile", "build": "gulp build", "start": "concurrent --kill-others \"gulp watch\" \"lite-server\"", "old_start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", "postinstall": "typings install" }, "license": "ISC", "dependencies": { "@angular/common": "~2.4.5", "@angular/compiler": "~2.4.5", "@angular/core": "~2.4.5", "@angular/forms": "~2.4.5", "@angular/http": "~2.4.5", "@angular/platform-browser": "~2.4.5", "@angular/platform-browser-dynamic": "~2.4.5", "@angular/router": "~3.4.5", "@angular/upgrade": "~2.4.5", "angular-in-memory-web-api": "~0.2.4", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "jquery": "^3.1.1", "jquery-ui": "^1.12.1", "components-jqueryui": "1.12.1", "jquery-ui-timepicker-addon": "^1.6.3", "js-marker-clusterer": "~1.0.0", "font-awesome": "^4.7.0", "ng2-translate": "^4.2.0", "primeng": "^1.1.4", "rxjs": "^5.1.0", "systemjs": "0.19.40", "zone.js": "^0.7.4" }, "devDependencies": { "@angular/cli": "^1.6.8", "@angular/compiler-cli": "~2.4.5", "@types/core-js": "^0.9.35", "@types/google-maps": "^3.2.0", "@types/googlemaps": "^3.30.7", "@types/node": "^6.0.101", "concurrently": "^3.1.0", "gulp": "^3.9.1", "gulp-cached": "^1.1.1", "gulp-changed": "^3.2.0", "gulp-gzip": "^1.4.2", "gulp-livereload": "^3.8.1", "gulp-npm-dist": "^1.0.1", "gulp-sourcemaps": "^1.6.0", "gulp-tar": "^2.1.0", "gulp-tslint": "^6.1.1 ", "gulp-typescript": "^2.14.1", "gulp-zip": "^4.1.0", "lite-server": "^2.2.2", "run-sequence": "^2.2.1", "ts-node": "^4.1.0", "tslint": "^3.5.0", "typescript": "~2.4.2", "typescript-register": "^1.1.0" } }

dshemendiuk commented 6 years ago

I can't check on Windows/Linux now, but on my mac:

[17:05:55] Using gulpfile ~/Projects/gulp-plugin-issue/gulpfile.js
[17:05:55] Starting 'copy'...
[17:05:55] Finished 'copy' after 263 ms
mariodeci commented 6 years ago

mmmm...it's strange, what can I try?

kfrancis commented 6 years ago

I'm also seeing the same thing. If it runs quickly, there's nothing done but a single empty folder. Every other run it just runs and runs with no output.