mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
ceab823447
Improve Storybook theming GitOrigin-RevId: f02f0cfc8d13ca1a1510bd840afdc8f326fb6750
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
const customConfig = require('../webpack.config.dev')
|
|
|
|
module.exports = {
|
|
stories: ['../frontend/stories/**/*.stories.js'],
|
|
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'],
|
|
webpackFinal: storybookConfig => {
|
|
// Combine Storybook's webpack loaders with our webpack loaders
|
|
const rules = [
|
|
// Filter out the Storybook font file loader, which overrides our font
|
|
// file loader causing the font to fail to load
|
|
...storybookConfig.module.rules.filter(
|
|
rule => !rule.test.toString().includes('woff')
|
|
),
|
|
// Replace the less rule, adding to-string-loader
|
|
...customConfig.module.rules.filter(
|
|
rule => !rule.test.toString().includes('less')
|
|
),
|
|
{
|
|
test: /\.less$/,
|
|
use: ['to-string-loader', 'css-loader', 'less-loader']
|
|
}
|
|
]
|
|
|
|
// Combine Storybook's webpack plugins with our webpack plugins
|
|
const plugins = [...storybookConfig.plugins, ...customConfig.plugins]
|
|
|
|
return {
|
|
...storybookConfig,
|
|
module: {
|
|
...storybookConfig.module,
|
|
rules
|
|
},
|
|
plugins
|
|
}
|
|
}
|
|
}
|