rsnext/packages/next/build
Christoph Tavan 14ed867537 Disable worker_threads by default for firebase compatibility (#9199)
* Pass config.experimental.cpus to export during build

Currently, there is no way of specifying the number of worker threads of
`next export` when run as part of `next build`.

I suggest a sane default should be to just use the same amount of
workers that were used during the build process which currently seems to
be configured through `config.experimental.cpus`.

This setting is already respected in the two other places where
jest-workers are in use: The TerserPlugin and the staticCheckWorkers in
`next build`.

* Only enable worker threads if there is more than 1 worker

Multiple worker threads can cause problems when certain dependencies are
being used, see e.g. https://github.com/zeit/next.js/issues/7894

This patch allows disabling of worker threads by setting
`config.experimental.cpus = 1`.

The benefit of spawning 1 worker thread, if there is any at all, should
very limited anyways, so the workload can just as well be processed in
the main thread.

* Disable parallel build for firebase authentication example

* Add integration test to cover #7894

* Rename test suite and add worker_threads config

* Disable worker_threads by default

* Update index.test.js

* Use workerThreads config for TerserPlugin

* Update to use workerThreads config in
TerserPlugin for consistency

* Disable node 12 specific test
2019-10-28 20:01:24 -04:00
..
babel Make sure to update scope for page export declaration (#9115) 2019-10-18 09:37:09 -05:00
output Add configuration flags to disable integrated type checker (#9138) 2019-10-28 11:02:03 -07:00
profiler Add custom profiler / tracer (#8378) 2019-08-18 21:45:39 +02:00
webpack Disable worker_threads by default for firebase compatibility (#9199) 2019-10-28 20:01:24 -04:00
compiler.ts Update webpack typings (#8783) 2019-09-18 11:24:37 -04:00
entries.ts Warn build on duplicate pages (#8646) 2019-09-11 14:26:10 -04:00
generate-build-id.ts Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00
index.ts Disable worker_threads by default for firebase compatibility (#9199) 2019-10-28 20:01:24 -04:00
is-writeable.ts Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00
spinner.ts Update resetting log for spinners (#8995) 2019-10-08 11:33:51 -05:00
utils.ts Add experimental SPR support (#8832) 2019-09-24 10:50:04 +02:00
webpack-config.ts Disable worker_threads by default for firebase compatibility (#9199) 2019-10-28 20:01:24 -04:00
write-build-id.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00