Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
3daa473e
Unverified
Commit
3daa473e
authored
Apr 26, 2019
by
Joe Haddad
Committed by
GitHub
Apr 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable Terser Cache When Using Flying Shuttle (#7168)
parent
6f0e795f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
webpack-config.ts
packages/next/build/webpack-config.ts
+1
-1
TaskRunner.js
...d/webpack/plugins/terser-webpack-plugin/src/TaskRunner.js
+5
-3
index.js
.../build/webpack/plugins/terser-webpack-plugin/src/index.js
+6
-2
No files found.
packages/next/build/webpack-config.ts
View file @
3daa473e
...
...
@@ -73,7 +73,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, d
const
terserPluginConfig
=
{
parallel
:
true
,
sourceMap
:
false
,
cache
:
true
,
cache
:
!
selectivePageBuilding
,
cpus
:
config
.
experimental
.
cpus
,
distDir
:
distDir
}
...
...
packages/next/build/webpack/plugins/terser-webpack-plugin/src/TaskRunner.js
View file @
3daa473e
...
...
@@ -12,8 +12,10 @@ const writeFileP = promisify(writeFile)
const
readFileP
=
promisify
(
readFile
)
export
default
class
TaskRunner
{
constructor
(
distDir
,
cpus
)
{
mkdirp
.
sync
((
this
.
cacheDir
=
join
(
distDir
,
'cache'
,
'next-minifier'
)))
constructor
({
distDir
,
cpus
,
cache
})
{
if
(
cache
)
{
mkdirp
.
sync
((
this
.
cacheDir
=
join
(
distDir
,
'cache'
,
'next-minifier'
)))
}
// In some cases cpus() returns undefined
// https://github.com/nodejs/node/issues/19022
...
...
@@ -68,7 +70,7 @@ export default class TaskRunner {
}
tasks
.
forEach
((
task
,
index
)
=>
{
const
cachePath
=
join
(
this
.
cacheDir
,
task
.
cacheKey
)
const
cachePath
=
this
.
cacheDir
&&
join
(
this
.
cacheDir
,
task
.
cacheKey
)
const
enqueue
=
()
=>
{
this
.
boundWorkers
(
task
,
(
error
,
data
)
=>
{
...
...
packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js
View file @
3daa473e
...
...
@@ -129,7 +129,11 @@ export class TerserPlugin {
apply
(
compiler
)
{
const
optimizeFn
=
(
compilation
,
chunks
,
callback
)
=>
{
const
taskRunner
=
new
TaskRunner
(
this
.
distDir
,
this
.
cpus
)
const
taskRunner
=
new
TaskRunner
({
distDir
:
this
.
distDir
,
cpus
:
this
.
cpus
,
cache
:
this
.
options
.
cache
,
})
const
processedAssets
=
new
WeakSet
()
const
tasks
=
[]
...
...
@@ -285,7 +289,7 @@ export class TerserPlugin {
template
.
hooks
.
hashForChunk
.
tap
(
plugin
,
hash
=>
{
// Terser version
// Has to be updated when options change too
hash
.
update
(
'3.17.0'
)
;
hash
.
update
(
'3.17.0'
)
return
hash
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment