0

Iam starter with Gulp. I installed Gulp and using command npm install --save-dev gulp-uglify installed this to C:/Program Files/nodejs/node_modules/gulp/node_modules folder gulp-uglify.

To gulp file I wrote:

var gulp = require('gulp'), uglify = require('gulp-uglify'); gulp.task('default', function(){ gulp.src('/js/*.js') .pipe(uglify()) .pipe(gulp.dest('minijs')); }); 

Now when I placed to C:/Program Files/nodejs/node_modules/gulp folder js with some JS file and at command line at C:/Program Files/nodejs/node_modules/gulp write gulp I find any new folder (as minijs).

Can I ask where I must place folder js?

Thanks

1 Answer 1

2

That´s because you've set the path as /js/*.js. This will match the files at the root, not the current folder.

So change it to ./js/*.js or simply remove the slash.

Also, it's not really recommanded to do this in your node_modules folder.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.