Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mistical2008 committed Nov 4, 2022
1 parent dcf0f82 commit fe01f03
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 15 deletions.
37 changes: 28 additions & 9 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
const react = require("@vitejs/plugin-react");

module.exports = {
addons: ['@storybook/addon-essentials'],
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: ['../public'],
addons: ["@storybook/addon-essentials"],
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
staticDirs: ["../public"],
features: {
storyStoreV7: true,
},
framework: '@storybook/react',
framework: "@storybook/react",
core: {
builder: '@storybook/builder-vite',
builder: "@storybook/builder-vite",
},
async viteFinal(config) {
config.plugins = config.plugins.filter(
(plugin) =>
!(Array.isArray(plugin) && plugin[0]?.name.includes("vite:react"))
);

config.plugins.push(
react({
exclude: [/\.stories\.(t|j)sx?$/, /node_modules/],
jsxImportSource: "@emotion/react",
babel: {
plugins: ["@emotion/babel-plugin"],
},
})
);

console.log(config.plugins);

config.optimizeDeps = {
...(config.optimizeDeps || {}),
include: [
...(config?.optimizeDeps?.include || []),
'msw-storybook-addon',
"msw-storybook-addon",
],
}
return config
};
return config;
},
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"storybook": "start-storybook -p 6006"
},
"dependencies": {
"@emotion/babel-plugin": "^11.10.5",
"@emotion/react": "^11.10.5",
"cross-fetch": "^3.1.5",
"react": "^17.0.2",
Expand Down
12 changes: 7 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react"
"jsxImportSource": "@emotion/react",
"types": ["vite/client", "@emotion/react/types/css-prop"]
},
"include": ["./src", "./.storybook"]
}

0 comments on commit fe01f03

Please sign in to comment.