Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Fix storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrgrundas committed Dec 3, 2020
1 parent d1914eb commit 2cb4c67
Show file tree
Hide file tree
Showing 17 changed files with 3,801 additions and 2,890 deletions.
14 changes: 8 additions & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");

module.exports = {
stories: ["../src/@next/**/stories.tsx"],
addons: [{
name: '@storybook/addon-essentials',
}],
addons: [
{
name: "@storybook/addon-essentials",
},
],

webpackFinal: async (config, { configType }) => {
config.module.rules.push({
Expand Down Expand Up @@ -50,9 +52,9 @@ module.exports = {
new ForkTsCheckerWebpackPlugin({
typescript: true,
eslint: {
files: './src/**/*.{ts,tsx}',
exclude: "node_modules"
}
files: "./src/**/*.{ts,tsx}",
exclude: "node_modules",
},
})
);

Expand Down
7 changes: 3 additions & 4 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
import { withNextRouter } from "storybook-addon-next-router";

import { OutLineDecorator } from "./OutlineDecorator";

export const parameters = {
name: "Saleor Storefront",
url: "https://github.com/mirumee/saleor-storefront",
goFullScreen: false,
sidebarAnimations: true,
sidebarAnimations: true,
controls: { expanded: true },
viewport: { viewports: INITIAL_VIEWPORTS },
};

export const decorators = [
OutLineDecorator,
];
export const decorators = [OutLineDecorator, withNextRouter];
4 changes: 4 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = api => {
const plugins = [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-typescript",
"babel-plugin-styled-components",
"transform-class-properties",
"@babel/transform-runtime",
"@babel/plugin-proposal-optional-chaining",
Expand All @@ -41,6 +42,9 @@ module.exports = api => {
},
]);
}
if (isStorybook) {
plugins.push("babel-plugin-styled-components");
}

plugins.push("macros");

Expand Down
Loading

0 comments on commit 2cb4c67

Please sign in to comment.