Skip to content

Commit

Permalink
thread-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored and Timer committed Mar 30, 2020
1 parent c5c4bef commit 84a46df
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Expand Up @@ -697,7 +697,7 @@ export default async function getBaseWebpackConfig(
},
},
{
loader: 'thread-loader',
loader: require.resolve('next/dist/compiled/thread-loader'),
options: {
workers: 2,
workerParallelJobs: Infinity,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Expand Up @@ -101,7 +101,6 @@
"sass-loader": "8.0.2",
"style-loader": "1.0.0",
"styled-jsx": "3.2.5",
"thread-loader": "2.1.3",
"url": "0.11.0",
"use-subscription": "1.1.1",
"watchpack": "2.0.0-beta.13",
Expand Down Expand Up @@ -195,6 +194,7 @@
"taskr": "1.1.0",
"terser": "4.4.2",
"text-table": "0.2.0",
"thread-loader": "2.1.3",
"typescript": "3.7.3",
"unfetch": "4.1.0",
"unistore": "3.4.1",
Expand Down
13 changes: 13 additions & 0 deletions packages/next/taskfile.js
Expand Up @@ -37,6 +37,10 @@ const externals = {
// dependents: webpack-dev-middleware
'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
Expand Down Expand Up @@ -366,6 +370,14 @@ export async function ncc_text_table(task, opts) {
.target('dist/compiled/text-table')
}
// 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'
export async function ncc_unistore(task, opts) {
await task
Expand Down Expand Up @@ -452,6 +464,7 @@ export async function precompile(task) {
'ncc_strip_ansi',
'ncc_terser',
'ncc_text_table',
'ncc_thread_loader',
'ncc_unistore',
'ncc_webpack_dev_middleware',
'ncc_webpack_hot_middleware',
Expand Down

0 comments on commit 84a46df

Please sign in to comment.