Reputation: 3062
I am developing a website that uses gulp to assist with development. I have a structure that looks similar to:
gulpfile.js
gulpfile.js
gulpfile.babel.js
When in the directory for Zurb's "Foundation for Emails", if I attempt to run any of the following:
npm start
foundation watch
npm run build
PowerShell says: "Changing working directory" and then runs the default gulp task in my Main Project folder. This does not happen when I run gulp commands from my UI Toolkit Folder.
However, if I delete the gulpfile.js
in my Main Project Folder, all three of those commands work as expected. What's happening? How can I make these commands work with a gulpfile.js
file in its parent's directory?
Upvotes: 0
Views: 367
Reputation: 30564
Open package.json
in your Foundaton For Emails folder and add the --gulpfile gulpfile.babel.js
option to all of your npm scripts:
"scripts": {
"start": "gulp --gulpfile gulpfile.babel.js",
"build": "gulp --gulpfile gulpfile.babel.js --production",
"zip": "gulp --gulpfile gulpfile.babel.js zip --production",
"litmus": "gulp --gulpfile gulpfile.babel.js litmus --production"
},
This forces gulp to use the correct gulpfile instead of traversing the directory hierarchy upwards.
Upvotes: 1