I'm running SPFx builds in a Docker container which works well. The approach is described here: https://github.com/waldekmastykarz/docker-spfx I'm using WSL2 and Ubuntu.

But unfortunately running gulp build --ship takes extreemely long to start. After running the command in the Docker container there is a delay of more than 60 seconds here:

enter image description here

After this long pause the build starts. Where is this pause coming from?

Running the command locally makes a pause for about 10 seconds before it starts.

I tested with a newly created SPFx project and here are the results:

gulp bundle --ship run locally:

enter image description here

gulp bundle --ship in the Docker container:

enter image description here

The bundling takes 38s longer in the container which would be fine (I guess). But apart from bundling gulp spends 1 minute and 18 seconds doing something else. But what?? Any hints are appreciated.

More tests

Docker image waldekm/spfx:1.11.0

enter image description here

  • Are you seeing this behavior in all SPFx versions or just the latest? – Waldek Mastykarz Jun 15 at 14:12
  • Initially I saw this behavior with a very old SPFx project (like 3 years old). Then I thought: maybe it works better with the newest version - it did not. So in sum I tested two versions and both show the long pause. Should I test more versions? – Heinrich Ulbricht Jun 15 at 14:14
  • @WaldekMastykarz I added another test - same result. – Heinrich Ulbricht Jun 15 at 14:40
  • My gut feeling says that gulp spends some time retrieving the list of available tasks, to see if the requested task can be executed, and building up the chain of tasks to execute. If the container is resources-constrained, it could take a moment. – Waldek Mastykarz 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.