Skip to content

Commit

Permalink
fix: Re-enable postcss for storybook builds to transpile svg-load (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
anicholls authored Nov 25, 2020
1 parent b823d31 commit ec9b7d8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
17 changes: 16 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
'storybook-readme',
'@storybook/addon-knobs',
'@storybook/addon-storysource',
'@storybook/preset-scss',
],
webpackFinal: async config => {
// Convert mdx links to point to github
Expand Down Expand Up @@ -47,6 +46,22 @@ module.exports = {
enforce: 'pre',
});

// Load our scss files with postscss.
// Note: This is the same as @storybook/preset-scss, but with postcss added.
config.module.rules.push({
test: /\.(scss|css)$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {importLoaders: 2},
},
'postcss-loader',
'sass-loader',
],
include: modulesPath,
});

config.plugins.push(new DocgenPlugin());

// Remove progress updates to reduce log lines in Travis
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@storybook/addon-storysource": "^6.1.3",
"@storybook/addon-viewport": "^6.1.3",
"@storybook/components": "^6.1.3",
"@storybook/preset-scss": "^1.0.3",
"@storybook/react": "^6.1.3",
"@storybook/source-loader": "^6.1.3",
"@testing-library/cypress": "^7.0.1",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4301,11 +4301,6 @@
dependencies:
core-js "^3.0.1"

"@storybook/preset-scss@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@storybook/preset-scss/-/preset-scss-1.0.3.tgz#8ac834545c642dada0f64f510ef08dfb882e9737"
integrity sha512-o9Iz6wxPeNENrQa2mKlsDKynBfqU2uWaRP80HeWp4TkGgf7/x3DVF2O7yi9N0x/PI1qzzTTpxlQ90D62XmpiTw==

"@storybook/react@^6.1.3":
version "6.1.3"
resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.1.3.tgz#558311ea377719d30b118c51c6ad2b8a0efc8971"
Expand Down

0 comments on commit ec9b7d8

Please sign in to comment.