#How can I configure file watch options for Esbuild?

8 messages · Page 1 of 1 (latest)

lyric lichen
#

Storybook v7.0.4

Does Esbuild have analogue of Webpack's watchOptions and poll? I run Storybook in Vagrant and it doesn't update list of sidebar stories after editing so I have to restart dev server every time I add new stories. For Webpack I add these options:

    config.watchOptions = {
      aggregateTimeout: 600,
      poll: 5000,
      ignored: /node_modules/,
    }

but managerWebpack is removed in v7. I couldn't find anything in documentation, GitHub, here.

upper spoke
#

@vague wagon ?

vague wagon
#

The manager doesn’t watch for file updates in any way at the moment. But the list of stories should not be determined by esbuild / the manager..

lyric lichen
vague wagon
#

I don’t understand the problem.
I don’t see how the manager is involved in this.
You make it sound as if saving the file doesn’t work?

lyric lichen
vague wagon
#

Ow I see you confusion.

The manager-builder has nothing to do with stories, even though it shows stories in the sidebar, the data/instruction for that comes from elsewhere, not by it's builder.
What should happen is that the storyIndexer should invalidate and cause the manager to fetch the data anew:
https://github.com/storybookjs/storybook/blob/35ece3887a4cfaf9fb15bdb5c248d538a72c351a/code/lib/core-server/src/utils/stories-json.ts#L24-L69

GitHub

Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation. - storybook/stories-json.ts at 35ece3887a4cfaf9fb15bdb5c248...

lyric lichen
# vague wagon Ow I see you confusion. The manager-builder has nothing to do with stories, eve...

Oh, thank you. I see you use Watchpack https://github.com/storybookjs/storybook/blob/35ece3887a4cfaf9fb15bdb5c248d538a72c351a/code/lib/core-server/src/utils/watch-story-specifiers.ts#L32 which is part of Webpack so it just has the same set of parameters Webpack use (aggregateTimeout, poll). It would be great to have the ability to set these parameters with command-line options or somehow else.

GitHub

Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation. - storybook/watch-story-specifiers.ts at 35ece3887a4cfaf9fb...