Commits
Art Lowel authored a5d61312381
51 51 | |
52 52 | let themePath; |
53 53 | |
54 54 | if (theme !== null && theme !== undefined) { |
55 55 | themePath = path.normalize(path.join(__dirname, '..', 'themes', theme)); |
56 56 | } |
57 57 | else { |
58 58 | themePath = srcPath; |
59 59 | } |
60 60 | |
61 + | const relativeThemePath = path.relative(srcPath, themePath); |
62 + | |
61 63 | const globalCSSImports = (env) => { return [ |
62 64 | buildRoot('styles/_variables.scss', env), |
63 65 | buildRoot('styles/_mixins.scss', env), |
64 66 | ]}; |
65 67 | |
66 68 | const getThemedPath = (componentPath, ext) => { |
67 69 | const parsedPath = path.parse(componentPath); |
68 70 | const relativePath = path.relative(srcPath, parsedPath.dir); |
69 - | return path.join(themePath, relativePath, `${parsedPath.name}.${ext}`); |
71 + | return path.join(relativeThemePath, relativePath, `${parsedPath.name}.${ext}`); |
70 72 | }; |
71 73 | |
72 74 | const themedTest = (origPath, extension) => { |
73 75 | if (/\.component.ts$/.test(origPath)) { // only match components |
74 76 | const themedPath = getThemedPath(origPath, extension); |
75 77 | return fs.existsSync(themedPath); |
76 78 | } else { |
77 79 | return false; |
78 80 | } |
79 81 | }; |