Skip to content

Commit

Permalink
Fix storybook build in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
minevala committed Jan 19, 2023
1 parent 515f506 commit ffb3984
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions packages/web-components/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
const postcss = require('postcss');
const postcssModules = require('postcss-modules');

const processor = postcss(
postcssModules({
global: true,
generateScopedName: '[local]',
getJSON: () => {}
}),
);

const webpackFinal = async (config) => ({
...config,
resolve: {
Expand All @@ -20,27 +31,14 @@ const webpackFinal = async (config) => ({
loader: 'lit-css-loader',
options: {
specifier: 'lit-element',
},
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
[
'postcss-modules',
{
global: true,
generateScopedName: '[local]'
},
],
],
transform: async (css, { filePath }) => {
return processor.process(css, { from: filePath }).then((result) => {
return result.css;
});
},
},
},
{
loader: 'sass-loader',
},
'sass-loader'
],
},
],
Expand Down

0 comments on commit ffb3984

Please sign in to comment.