Skip to content

Commit

Permalink
Merge pull request #100 from emulsify-ds/multilevel-global-scss
Browse files Browse the repository at this point in the history
Multilevel global scss
  • Loading branch information
callinmullaney authored Nov 25, 2024
2 parents ff5939c + 675c76e commit 2114dc3
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 233 deletions.
11 changes: 8 additions & 3 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ function getEntries(
// Non-component or global SCSS entries.
glob.sync(BaseScssMatcher).forEach((file) => {
const filePath = file.split(`${srcDir}/`)[1];
const filePathDist = filePath.split('/')[1]
? filePath.split('/')[1]
: filePath.split('/')[0];
// Support multi-level folder structures.
let filePathDist = filePath.split('/')[0];
if (filePath.split('/')[1] && !filePath.split('/')[1].endsWith('.scss')) {
filePathDist = filePath.split('/')[1];
}
if (filePath.split('/')[2]) {
filePathDist = `${filePath.split('/')[1]}/${filePath.split('/')[2]}`;
}
const newfilePath = fs.existsSync(path.resolve(projectDir, 'src'))
? `dist/global/${filePathDist.replace('.scss', '')}`
: `dist/css/${filePathDist.replace('.scss', '')}`;
Expand Down
Loading

0 comments on commit 2114dc3

Please sign in to comment.