overleaf/services/web/.storybook/main.js
Alf Eaton 7f4934d619 Add TypeScript file extensions to Storybook config (#7163)
GitOrigin-RevId: f070c8555d570bfdf02958bfbb241def8cacb263
2022-03-23 09:02:51 +00:00

36 lines
848 B
JavaScript

const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
// NOTE: must be set before webpack config is imported
process.env.SHARELATEX_CONFIG = path.resolve(
__dirname,
'../config/settings.webpack.js'
)
const customConfig = require('../webpack.config.dev')
module.exports = {
staticDirs: ['../public'],
stories: [
'../frontend/stories/**/*.stories.{js,ts,tsx}',
'../modules/**/stories/**/*.stories.{js,ts,tsx}',
],
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'],
webpackFinal: storybookConfig => {
const rules = [
...storybookConfig.module.rules,
{
test: /\.worker\.js$/,
use: 'worker-loader',
},
]
return {
...storybookConfig,
module: {
...storybookConfig.module,
rules,
},
}
},
}