Skip to content

Commit

Permalink
fix: configure storybook for nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph0enixKM committed Jul 18, 2023
1 parent d68d1b4 commit bdd97e3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { StorybookConfig } from "@storybook/nextjs";
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
staticDirs: ['../public'],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
Expand Down
5 changes: 5 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ const preview: Preview = {
date: /Date$/,
},
},
options: {
storySort: {
order: ["Atoms", "Molecules", "Organisms"],
}
}
},
};

Expand Down
12 changes: 12 additions & 0 deletions .storybook/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// .storybook/webpack.config.js
const path = require('path');

module.exports = ({ config }) => {
config.resolve.alias = {
...config.resolve.alias,
// path to the src folder
'@': path.resolve(__dirname, '../src'),
};

return config;
};

0 comments on commit bdd97e3

Please sign in to comment.