mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 17:24:15 +01:00
a4221e4499
* remove stories folder * return `null` like a component type can * un-default exports * add onboarding stories
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
const { createEntry } = require('../webpack.config')
|
|
const babelConfig = require('../babel.config')
|
|
|
|
module.exports = {
|
|
stories: ['../frontend/src/**/*.stories.@(js|jsx|ts|tsx)'],
|
|
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
|
babel: async (options) => {
|
|
// compile babel to "defaults" target (ES5)
|
|
const envPreset = babelConfig.presets.find(
|
|
(preset) => Array.isArray(preset) && preset[0] === '@babel/preset-env'
|
|
)
|
|
envPreset[1].targets = 'defaults'
|
|
return babelConfig
|
|
},
|
|
webpackFinal: (config) => {
|
|
const mainConfig = createEntry('main')
|
|
const newConfig = {
|
|
...config,
|
|
resolve: {
|
|
...config.resolve,
|
|
extensions: [...config.resolve.extensions, ...mainConfig.resolve.extensions],
|
|
alias: { ...config.resolve.alias, ...mainConfig.resolve.alias },
|
|
},
|
|
module: {
|
|
...config.module,
|
|
rules: [
|
|
...mainConfig.module.rules,
|
|
...config.module.rules.filter((rule) => rule.test.toString().includes('.mdx')),
|
|
],
|
|
},
|
|
}
|
|
return newConfig
|
|
},
|
|
}
|