Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy compile with storybook preset causes double build on initialization #14

Open
devtreehouse opened this issue Mar 23, 2020 · 0 comments

Comments

@devtreehouse
Copy link

devtreehouse commented Mar 23, 2020

With a brand new storybook, adding lazy-compile-webpack-plugin causes webpack to potentially build a few times.

I have successfully duplicated the bug in the repository:
https://github.com/devtreehouse/StorybookLazyCompile
(This is using webpack 4 and above)

To start the app, clone the repo, do yarn, and then yarn storybook. Once webpage starts, observe console.
Sometimes the build only does once, sometimes it does twice or even 3 times.

One time:
image

Three times:
image

In our production repo, one build takes 2 minutes, so... rebuilding means waiting for 2 more minutes randomly, that means it defeats the purpose of saving time on lazy compile.

Additional context:
In our main app, I realized that on the second build, it goes and try to do a full build, that means all react suspense (code splitted) code will be built. But it doesn't happen on the first time.
Also I noticed the first build is not success, as some images on our webpage are not being displayed. I think it might be webpack trying to make up for it, but it never happens without this plugin enabled.

Would greatly appreciate it if you can take a look. I really want to use this in our official dev environment. I am also personally trying to learn webpack plugin to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant