We use the following to allow different users or computers to have their own gulp configuration.
Last active
July 10, 2018 23:53
-
-
Save cwparsons/30157339b16b81c5e44f49103728d23f to your computer and use it in GitHub Desktop.
User configuration for a gulpfile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the normal configuration entry, and if a user one exists, merge those values in. | |
*/ | |
module.exports = () => { | |
const defaultConfig = require('./gulp-config'); | |
try { | |
const devConfig = require('./gulp-dev-config'); | |
if (devConfig) { | |
return Object.assign(defaultConfig, devConfig); | |
} | |
} catch (e) { | |
return defaultConfig; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The normal configuration json file. | |
{ | |
"projectFolder": "C:\\inetpub\\Sitecore\\Website" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a user configuration json file. | |
{ | |
"projectFolder": "D:\\Sitecore\\Website" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an example file to help developers understand the functionality is available. | |
{ | |
"projectFolder": ""D:\\Sitecore\\Website" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run the config utility immediately. | |
const config = require('./config')(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"gulp": "3.9.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment