-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose config and pathBuilder. (#57)
* Exposed config and pathBuilder * pathBuilder is now a function. * Added pathbuilder update function to allow paths to be updated using latest config values. * Service worker path updated. * Spelling mistaxe. * Updated readme and changelog. * Bumped package version. * Updated changelog. * Updated readme contents. * Updated readme. * Updated readme. * Updated readme. * Removed option default parameter and simplified condition. * Fixed changelog order. * Removed let statement. * Updated lint documentation.
- Loading branch information
1 parent
e583ece
commit baa1528
Showing
7 changed files
with
243 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@justeat/gulp-build-fozzie", | ||
"version": "3.8.0", | ||
"version": "4.0.0", | ||
"description": "Gulp build tasks for use across Fozzie modules", | ||
"main": "index.js", | ||
"author": "Damian Mullins <[email protected]> (http://www.damianmullins.com)", | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,45 @@ | ||
const config = require('./config'); | ||
const baseConfig = require('./config'); | ||
|
||
const docsSrcDir = `${config.docs.rootDir}/${config.docs.srcDir}`; | ||
const docsDistDir = `${config.docs.rootDir}/${config.docs.distDir}`; | ||
|
||
const pathBuilder = { | ||
const buildPaths = config => { | ||
|
||
scssSrcDir: `${config.assetSrcDir}/${config.css.scssDir}`, | ||
cssDistDir: `${config.assetDistDir}/${config.css.cssDir}`, | ||
const docsSrcDir = `${config.docs.rootDir}/${config.docs.srcDir}`; | ||
const docsDistDir = `${config.docs.rootDir}/${config.docs.distDir}`; | ||
|
||
jsSrcDir: `${config.assetSrcDir}/${config.js.jsDir}`, | ||
jsDistDir: `${config.assetDistDir}/${config.js.jsDir}`, | ||
return { | ||
scssSrcDir: `${config.assetSrcDir}/${config.css.scssDir}`, | ||
cssDistDir: `${config.assetDistDir}/${config.css.cssDir}`, | ||
|
||
imgSrcDir: `${config.assetSrcDir}/${config.img.imgDir}`, | ||
imgDistDir: `${config.assetDistDir}/${config.img.imgDir}`, | ||
jsSrcDir: `${config.assetSrcDir}/${config.js.jsDir}`, | ||
jsDistDir: `${config.assetDistDir}/${config.js.jsDir}`, | ||
|
||
swOutputPath: `${config.webRootDir}/${config.sw.outputFile}`, | ||
swSrcDir: `${config.assetSrcDir}/${config.sw.swDir}`, | ||
swDistDir: `${config.assetDistDir}/${config.sw.swDir}`, | ||
imgSrcDir: `${config.assetSrcDir}/${config.img.imgDir}`, | ||
imgDistDir: `${config.assetDistDir}/${config.img.imgDir}`, | ||
|
||
docsSrcDir, | ||
docsDistDir, | ||
docsTemplateDir: `${docsSrcDir}/${config.docs.templDir}`, | ||
docsDataDir: `${docsSrcDir}/${config.docs.dataDir}`, | ||
docsCssDistDir: `${docsDistDir}/${config.docs.assetDir}${config.css.cssDir}`, | ||
docsJsDistDir: `${docsDistDir}/${config.docs.assetDir}${config.js.jsDir}`, | ||
docsImgDistDir: `${docsDistDir}/${config.docs.assetDir}${config.img.imgDir}` | ||
swOutputPath: `${config.webRootDir}`, | ||
swSrcDir: `${config.assetSrcDir}/${config.sw.swDir}`, | ||
swDistDir: `${config.assetDistDir}/${config.sw.swDir}`, | ||
|
||
docsSrcDir, | ||
docsDistDir, | ||
docsTemplateDir: `${docsSrcDir}/${config.docs.templDir}`, | ||
docsDataDir: `${docsSrcDir}/${config.docs.dataDir}`, | ||
docsCssDistDir: `${docsDistDir}/${config.docs.assetDir}${config.css.cssDir}`, | ||
docsJsDistDir: `${docsDistDir}/${config.docs.assetDir}${config.js.jsDir}`, | ||
docsImgDistDir: `${docsDistDir}/${config.docs.assetDir}${config.img.imgDir}` | ||
}; | ||
}; | ||
|
||
const pathBuilder = () => { | ||
|
||
let paths = buildPaths(baseConfig); | ||
|
||
paths.update = config => { | ||
const updated = buildPaths(config); | ||
paths = Object.assign(paths, updated); | ||
}; | ||
|
||
return paths; | ||
}; | ||
|
||
module.exports = pathBuilder; | ||
module.exports = pathBuilder(); |
Oops, something went wrong.