From 7921b7b0d2052a80ea70880a1ed84c16dffb907c Mon Sep 17 00:00:00 2001 From: Callin Mullaney <57088-callinmullaney@users.noreply.drupalcode.org> Date: Thu, 12 Sep 2024 15:50:33 -0500 Subject: [PATCH] feat: compiled component-library-specific files into storybook folder --- config/webpack/webpack.common.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/webpack/webpack.common.js b/config/webpack/webpack.common.js index 87fb1a1..3737df1 100644 --- a/config/webpack/webpack.common.js +++ b/config/webpack/webpack.common.js @@ -21,7 +21,10 @@ const BaseScssPattern = fs.existsSync(path.resolve(projectDir, 'src')) const ComponentScssPattern = fs.existsSync(path.resolve(projectDir, 'src')) ? path.resolve(srcDir, 'components/**/!(_*|cl-*|sb-*).scss') : path.resolve(srcDir, '**/!(_*|cl-*|sb-*).scss'); -const ComponentLibraryScssPattern = path.resolve(srcDir, 'util/**/!(_).scss'); +const ComponentLibraryScssPattern = path.resolve( + srcDir, + '**/*{cl-*,sb-*}.scss', +); // Glob pattern for JS files. const jsPattern = fs.existsSync(path.resolve(projectDir, 'src')) @@ -83,7 +86,7 @@ function getEntries( entries[newfilePath] = file; }); - // Component SCSS entries. + // Component SCSS entries.- glob.sync(ComponentScssMatcher).forEach((file) => { const filePath = file.split('components/')[1]; const filePathDist = replaceLastSlash(filePath, '/css/'); @@ -100,7 +103,7 @@ function getEntries( // Component Library SCSS entries. glob.sync(ComponentLibraryScssMatcher).forEach((file) => { - const filePath = file.split(/util/)[1]; + const filePath = file.split(`${srcDir}/`)[1]; const newfilePath = `dist/storybook/${filePath.replace('.scss', '')}`; entries[newfilePath] = file; });