overleaf/services/web/.storybook/main.js
Alf Eaton 7be97fb2e2 [web] Fix Storybook (#6803)
* Move deprecated CLI option to config
* Reduce custom Storybook webpack config
* Upgrade Storybook
* Update package-lock.json

GitOrigin-RevId: e480aa0298e481d3e78a62b91c067b62c05bdeaf
2022-02-24 09:03:32 +00:00

36 lines
830 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',
'../modules/**/stories/**/*.stories.js',
],
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,
},
}
},
}