Commit 84a46dfb authored by Guy Bedford's avatar Guy Bedford Committed by Joe Haddad

thread-loader

parent c5c4bef9
...@@ -697,7 +697,7 @@ export default async function getBaseWebpackConfig( ...@@ -697,7 +697,7 @@ export default async function getBaseWebpackConfig(
}, },
}, },
{ {
loader: 'thread-loader', loader: require.resolve('next/dist/compiled/thread-loader'),
options: { options: {
workers: 2, workers: 2,
workerParallelJobs: Infinity, workerParallelJobs: Infinity,
......
...@@ -101,7 +101,6 @@ ...@@ -101,7 +101,6 @@
"sass-loader": "8.0.2", "sass-loader": "8.0.2",
"style-loader": "1.0.0", "style-loader": "1.0.0",
"styled-jsx": "3.2.5", "styled-jsx": "3.2.5",
"thread-loader": "2.1.3",
"url": "0.11.0", "url": "0.11.0",
"use-subscription": "1.1.1", "use-subscription": "1.1.1",
"watchpack": "2.0.0-beta.13", "watchpack": "2.0.0-beta.13",
...@@ -195,6 +194,7 @@ ...@@ -195,6 +194,7 @@
"taskr": "1.1.0", "taskr": "1.1.0",
"terser": "4.4.2", "terser": "4.4.2",
"text-table": "0.2.0", "text-table": "0.2.0",
"thread-loader": "2.1.3",
"typescript": "3.7.3", "typescript": "3.7.3",
"unfetch": "4.1.0", "unfetch": "4.1.0",
"unistore": "3.4.1", "unistore": "3.4.1",
......
...@@ -37,6 +37,10 @@ const externals = { ...@@ -37,6 +37,10 @@ const externals = {
// dependents: webpack-dev-middleware // dependents: webpack-dev-middleware
'webpack/lib/node/NodeOutputFileSystem': 'webpack/lib/node/NodeOutputFileSystem':
'webpack/lib/node/NodeOutputFileSystem', 'webpack/lib/node/NodeOutputFileSystem',
// dependents: thread-loader
'neo-async': 'neo-async',
'loader-runner': 'loader-runner',
'loader-utils': 'loader-utils',
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
...@@ -366,6 +370,14 @@ export async function ncc_text_table(task, opts) { ...@@ -366,6 +370,14 @@ export async function ncc_text_table(task, opts) {
.target('dist/compiled/text-table') .target('dist/compiled/text-table')
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
externals['thread-loader'] = 'next/dist/compiled/thread-loader'
export async function ncc_thread_loader(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('thread-loader')))
.ncc({ packageName: 'thread-loader', externals })
.target('dist/compiled/thread-loader')
}
// eslint-disable-next-line camelcase
externals['unistore'] = 'next/dist/compiled/unistore' externals['unistore'] = 'next/dist/compiled/unistore'
export async function ncc_unistore(task, opts) { export async function ncc_unistore(task, opts) {
await task await task
...@@ -452,6 +464,7 @@ export async function precompile(task) { ...@@ -452,6 +464,7 @@ export async function precompile(task) {
'ncc_strip_ansi', 'ncc_strip_ansi',
'ncc_terser', 'ncc_terser',
'ncc_text_table', 'ncc_text_table',
'ncc_thread_loader',
'ncc_unistore', 'ncc_unistore',
'ncc_webpack_dev_middleware', 'ncc_webpack_dev_middleware',
'ncc_webpack_hot_middleware', 'ncc_webpack_hot_middleware',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment