-
Notifications
You must be signed in to change notification settings - Fork 11
/
pathBuilder.js
51 lines (38 loc) · 1.78 KB
/
pathBuilder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const baseConfig = require('./config');
const buildPaths = config => {
const docsSrcDir = `${config.docs.rootDir}/${config.docs.srcDir}`;
const docsDistDir = `${config.docs.rootDir}/${config.docs.distDir}`;
const docsAssetsDistDir = `${docsDistDir}/${config.docs.assetDir}`;
return {
scssSrcDir: `${config.assetSrcDir}/${config.css.scssDir}`,
cssDistDir: `${config.assetDistDir}/${config.css.cssDir}`,
jsSrcDir: `${config.assetSrcDir}/${config.js.jsDir}`,
jsDistDir: `${config.assetDistDir}/${config.js.jsDir}`,
jsErrorLoggerDir: `${config.assetDistDir}/${config.logger.dir}`,
imgSrcDir: `${config.assetSrcDir}/${config.img.imgDir}`,
imgDistDir: `${config.assetDistDir}/${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}`,
docsAssetsDistDir,
docsCssDistDir: `${docsAssetsDistDir}${config.css.cssDir}`,
docsJsDistDir: `${docsAssetsDistDir}${config.js.jsDir}`,
docsImgDistDir: `${docsAssetsDistDir}${config.img.imgDir}`,
docsFontsDistDir: `${docsAssetsDistDir}${config.fonts.fontsDir}`,
fontsSrcDir: `${config.assetSrcDir}/${config.fonts.fontsDir}`,
fontsDistDir: `${config.assetDistDir}/${config.fonts.fontsDir}`
};
};
const pathBuilder = () => {
let paths = buildPaths(baseConfig);
paths.update = config => {
const updated = buildPaths(config);
paths = Object.assign(paths, updated);
};
return paths;
};
module.exports = pathBuilder();