Fix rewrite shape in Storybook (#24827)

This fixes a bug in `@next/plugin-storybook` caused by an update in the rewrite structure, solution was provided by @stefanprobst https://github.com/vercel/next.js/issues/19345#issuecomment-818856655

Secondary question: it would be awesome if someone at Next could help translating `preset.js` into TypeScript, this would catch those bugs immediately. I've tried in https://github.com/vercel/next.js/pull/18367 but failed to build correctly.

## Bug

- [X] Related issues linked using `fixes #number` => parent issue is an umbrella of various small issues: https://github.com/vercel/next.js/issues/19345
- [X] Integration tests added => reproduction is implemented in https://github.com/lbke/next-plugin-storybook-demo until the package is more stable
This commit is contained in:
Eric Burel 2021-05-06 19:04:22 +02:00 committed by GitHub
parent 467ec2115c
commit 796c021278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ async function webpackFinal(config) {
target: 'server',
config: nextConfig,
buildId: 'storybook',
rewrites: [],
rewrites: { beforeFiles: [], afterFiles: [], fallback: [] },
})
config.plugins = [...config.plugins, ...nextWebpackConfig.plugins]