rsnext/packages/next/build/webpack/plugins
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
..
terser-webpack-plugin Disable worker_threads by default for firebase compatibility (#9199) 2019-10-28 20:01:24 -04:00
build-manifest-plugin.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
chunk-graph-plugin.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
chunk-names-plugin.ts Revert "ncc Webpack build redux (#7628)" 2019-06-24 09:48:26 -04:00
css-minimizer-plugin.ts Reduce Install Size (#8788) 2019-09-18 13:59:46 -04:00
dll-import.ts Revert "ncc Webpack build redux (#7628)" 2019-06-24 09:48:26 -04:00
next-drop-client-page-plugin.ts Experimental module/nomodule support (#7704) 2019-07-24 22:16:32 -04:00
next-esm-plugin.ts Experimental: Granular build chunking (#7696) 2019-08-08 13:14:33 -04:00
nextjs-require-cache-hot-reloader.ts Revert "ncc Webpack build redux (#7628)" 2019-06-24 09:48:26 -04:00
nextjs-ssr-import.ts Revert "ncc Webpack build redux (#7628)" 2019-06-24 09:48:26 -04:00
nextjs-ssr-module-cache.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
pages-manifest-plugin.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00
profiling-plugin.ts Add custom profiler / tracer (#8378) 2019-08-18 21:45:39 +02:00
react-loadable-plugin.ts Add updated de-duping logic for next/dynamic (#7705) 2019-06-28 20:48:28 -04:00
serverless-plugin.ts Remove __NEXT_REPLACE__BUILD_ID__ workaround (#8445) 2019-08-20 12:38:14 -04:00
unlink-removed-pages-plugin.ts Move next-server back into next package (#8613) 2019-09-04 10:00:54 -04:00