Fix Babel compilation error

The default Storybook Babel config did not recognize the `public`
keyword in our custom errors (e.g. `ExhaustivityCheckingError`
and `RedactableError`). To fix this, we can use Storybook's V7 mode to
supply a custom Babel config. This fixes the compilation error.

See: https://storybook.js.org/docs/react/configure/babel
This commit is contained in:
Koen Vlaswinkel
2023-04-03 16:37:29 +02:00
parent 1bcc13af7c
commit bb05220b2c
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}

View File

@@ -12,6 +12,9 @@ const config: StorybookConfig = {
core: {
builder: "@storybook/builder-webpack5",
},
features: {
babelModeV7: true,
},
};
module.exports = config;