提交 84a46dfb 编写于 作者: G Guy Bedford 提交者: Joe Haddad

thread-loader

上级 c5c4bef9
......@@ -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,
......
......@@ -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",
......@@ -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",
......
......@@ -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
......@@ -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
......@@ -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',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册