Skip to content

fix: converting stories #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix: correct configuration
Signed-off-by: Shubham Shah <shubhamshahrising@gmail.com>
  • Loading branch information
SavvyShah committed Oct 3, 2022
commit 8424626fb15f827a690706d3c4cb8376937b39f1
31 changes: 30 additions & 1 deletion web-app/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

// import '../src/styles/reset.css'

module.exports = {
core: {
builder: 'webpack5',
builder: 'webpack4',
},
stories: ['../stories/Temp.stories.tsx', '../stories/Error.stories.tsx'],
addons: ['@storybook/addon-actions', '@storybook/addon-knobs', '@storybook/addon-links'],
babel: async (options) => ({
...options,
presets: [...options.presets, '@emotion/babel-preset-css-prop', '@babel/preset-react'],
plugins: [
[
'import',
{
libraryName: '@alifd/next',
style: true,
},
],
],
}),
webpackFinal: (config) => {
config.module.rules.push({
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
})
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('babel-loader'),
})

config.plugins.push(new MiniCssExtractPlugin({ filename: '[name].css' }))
config.resolve.extensions.push('.ts', '.tsx')

config.resolve.modules = ['node_modules', path.resolve(__dirname, '../src')]

return config
},
}