简体   繁体   中英

How to make a path for gulp file in project's directory in package.json

So I have a directory "node", where I run a lot of different projects, there are 2 directories, one is "examples", that provide some modules, and "projects", where I combine them to smth good. And so, in one of projects I started to use gulp, but, all package.json "scripts" I saw was like test : 'gulp' and etc, and in my case it doses not see my one.
node | +-- examples +-- projects | +-- 1 +-- 2 | +--gulpfile.js node | +-- examples +-- projects | +-- 1 +-- 2 | +--gulpfile.js What I can do, to set up my package.json to see the gulp file inside the "2" directory?

I tried to set up a new package.json inside "2", but it makes node_modules download one more, and that's actually bad, however, it works, so there is no problem with gulp file.

I expect that gulpfile.js inside 2 will be found without new package json.

Simplest way is to specify the gulpfile when you run gulp. Assuming you run from the node directory:

gulp --gulpfile=projects/2/gulpfile.js

Gulp also supports a .gulp.json CLI configuration file where you can specify that command line flag so you don't have to repeat it every time you run it. Check the documentation for more info.

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