Skip to content

Commit

Permalink
Enable esbuild keep names as workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
bodograumann committed Aug 18, 2022
1 parent a824bef commit 94923b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/builder-vite/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export async function build(options: ExtendedOptions) {
emptyOutDir: false, // do not clean before running Vite build - Storybook has already added assets in there!
sourcemap: true,
},
esbuild: {
// Workaround for #206: https://github.com/storybookjs/builder-vite/issues/206#issuecomment-1122347230
// Makes sure that mocked actions can be recognized in the production build.
keepNames: true,
},
};

const finalConfig = await presets.apply('viteFinal', config, options);
Expand Down

0 comments on commit 94923b1

Please sign in to comment.