2021-03-03 07:52:29 -05:00
|
|
|
const path = require('path')
|
2021-10-12 04:49:07 -04:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
2021-03-03 07:52:29 -05:00
|
|
|
|
|
|
|
// NOTE: must be set before webpack config is imported
|
|
|
|
process.env.SHARELATEX_CONFIG = path.resolve(
|
|
|
|
__dirname,
|
2021-05-19 08:07:10 -04:00
|
|
|
'../config/settings.webpack.js'
|
2021-03-03 07:52:29 -05:00
|
|
|
)
|
|
|
|
|
2020-09-25 04:40:19 -04:00
|
|
|
const customConfig = require('../webpack.config.dev')
|
|
|
|
|
|
|
|
module.exports = {
|
2022-02-23 05:04:15 -05:00
|
|
|
staticDirs: ['../public'],
|
2021-03-03 07:52:29 -05:00
|
|
|
stories: [
|
2022-03-22 06:18:48 -04:00
|
|
|
'../frontend/stories/**/*.stories.{js,ts,tsx}',
|
|
|
|
'../modules/**/stories/**/*.stories.{js,ts,tsx}',
|
2021-03-03 07:52:29 -05:00
|
|
|
],
|
2020-09-25 04:40:19 -04:00
|
|
|
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'],
|
|
|
|
webpackFinal: storybookConfig => {
|
|
|
|
const rules = [
|
2022-02-23 05:04:15 -05:00
|
|
|
...storybookConfig.module.rules,
|
2021-02-09 10:39:29 -05:00
|
|
|
{
|
2022-02-23 05:04:15 -05:00
|
|
|
test: /\.worker\.js$/,
|
|
|
|
use: 'worker-loader',
|
2021-04-27 03:52:58 -04:00
|
|
|
},
|
2020-09-25 04:40:19 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
return {
|
|
|
|
...storybookConfig,
|
|
|
|
module: {
|
|
|
|
...storybookConfig.module,
|
2021-04-27 03:52:58 -04:00
|
|
|
rules,
|
2020-09-25 04:40:19 -04:00
|
|
|
},
|
|
|
|
}
|
2021-04-27 03:52:58 -04:00
|
|
|
},
|
2020-09-25 04:40:19 -04:00
|
|
|
}
|