kopia lustrzana https://github.com/wagtail/wagtail
Fix Storybook not supporting TypeScript declare class fields
rodzic
fa1cbfbe98
commit
0246d3a6f4
|
@ -14,6 +14,18 @@ module.exports = {
|
|||
core: {
|
||||
builder: 'webpack5',
|
||||
},
|
||||
// Redefine Babel config to allow TypeScript class fields `declare`.
|
||||
// See https://github.com/storybookjs/storybook/issues/12479.
|
||||
// The resulting configuration is closer to Wagtail’s Webpack + TypeScript setup,
|
||||
// preventing other potential issues with JS transpilation differences.
|
||||
babel: async (options) => ({
|
||||
...options,
|
||||
plugins: [],
|
||||
presets: [
|
||||
['@babel/preset-typescript', { allowDeclareFields: true }],
|
||||
['@babel/preset-react', { runtime: 'automatic' }],
|
||||
],
|
||||
}),
|
||||
webpackFinal: (config) => {
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue