简体   繁体   中英

gulp - do i have to install plugins for every project?

I have a question about gulp.

I understand that when i want to use gulp with my project I need to run "npm init" for package json, I need to install gulp locally (assuming globally is already installed) with "npm install --save-dev gulp" and i need to install all the plugins i want to use (--save-dev so locally?). Im using about 10 gulp plugins and thats about 300mb+ of download (i dont understand why) for every project. Also the download is taking way too much time.

My question is: do i have to install all plugins for every new project i want to run with gulp? Or can i just copy gulp file and run it without installing plugins all over again because it takes 30 minutes to install them...

No. You basically have these options:

npm install pkg           // install package locally
npm install -g pkg        // install globally
npm install pkg --save    // install package locally and save to package.json
npm install -g pkg --save // install package globally and save to package.json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM