Skip to content

Commit

Permalink
feat: compiled component-library-specific files into storybook folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Callin Mullaney committed Sep 12, 2024
1 parent e8210a0 commit 7921b7b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -83,7 +86,7 @@ function getEntries(
entries[newfilePath] = file;

Check warning on line 86 in config/webpack/webpack.common.js

View workflow job for this annotation

GitHub Actions / build

Generic Object Injection Sink

Check warning on line 86 in config/webpack/webpack.common.js

View workflow job for this annotation

GitHub Actions / build

Generic Object Injection Sink
});

// Component SCSS entries.
// Component SCSS entries.-
glob.sync(ComponentScssMatcher).forEach((file) => {
const filePath = file.split('components/')[1];
const filePathDist = replaceLastSlash(filePath, '/css/');
Expand All @@ -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;

Check warning on line 108 in config/webpack/webpack.common.js

View workflow job for this annotation

GitHub Actions / build

Generic Object Injection Sink

Check warning on line 108 in config/webpack/webpack.common.js

View workflow job for this annotation

GitHub Actions / build

Generic Object Injection Sink
});
Expand Down

0 comments on commit 7921b7b

Please sign in to comment.