rsnext/packages/next/next-server/server
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
..
lib Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
api-utils.ts API: Take multiple values into account for the query (#9196) 2019-10-26 20:10:06 +02:00
config.ts Disable worker_threads by default for firebase compatibility (#9199) 2019-10-28 20:01:24 -04:00
get-page-files.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
load-components.ts Add warning for getStaticParams without getStaticProps (#9226) 2019-10-28 10:24:29 -07:00
next-server.ts Cache No-Revalidate Pages (#9170) 2019-10-22 20:40:33 -04:00
normalize-page-path.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
optimize-amp.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
render.tsx Add warning for getStaticParams without getStaticProps (#9226) 2019-10-28 10:24:29 -07:00
require.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
router.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
send-html.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
serve-static.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
spr-cache.ts Ensure directory before flushing cache file (#9187) 2019-10-25 13:56:00 -07:00
utils.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00