Skip to content

Commit

Permalink
Remove extra lines and use es modules in main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiovanacloig committed Oct 3, 2023
1 parent bb1ff26 commit be4d0a2
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { dirname, join } from 'path';

module.exports = {
stories: ['../malty/!(icons)/!(IconWrapper)/*.stories.@(mdx|js|jsx|ts|tsx)'],
function getAbsolutePath(value) {
return dirname(require.resolve(join(value, 'package.json')));
}

export default {
stories: ['../malty/!(icons)/!(IconWrapper)/*.stories.@(mdx|js|jsx|ts|tsx)'],
addons: [
{
name: '@storybook/addon-links',
name: '@storybook/addon-essentials'
}
],

typescript: {
check: false,
checkOptions: {},
Expand All @@ -19,9 +21,7 @@ module.exports = {
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true)
}
},

staticDirs: [{ from: '../public/storybook', to: '/' }],

previewHead: (head) => `
${head}
<style>
Expand All @@ -33,17 +33,11 @@ module.exports = {
}
</style>
`,

framework: {
name: getAbsolutePath('@storybook/react-webpack5'),
options: {}
},

docs: {
autodocs: true
}
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, 'package.json')));
}

0 comments on commit be4d0a2

Please sign in to comment.