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
40f6bdef
Commit
40f6bdef
authored
Mar 29, 2020
by
Guy Bedford
Committed by
Joe Haddad
Mar 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autodll-webpack-plugin
parent
8b1ea308
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
26 deletions
+28
-26
autodll-webpack-plugin.js
packages/next/build/bundles/autodll-webpack-plugin.js
+14
-0
webpack-config.ts
packages/next/build/webpack-config.ts
+3
-2
dll-import.ts
packages/next/build/webpack/plugins/dll-import.ts
+0
-23
package.json
packages/next/package.json
+1
-1
taskfile.js
packages/next/taskfile.js
+10
-0
No files found.
packages/next/build/bundles/autodll-webpack-plugin.js
0 → 100644
View file @
40f6bdef
const
path
=
require
(
'path'
)
module
.
exports
=
distDir
=>
{
const
autodllCachePath
=
path
.
resolve
(
path
.
join
(
distDir
,
'cache'
,
'autodll-webpack-plugin'
)
)
const
autoDllWebpackPluginPaths
=
require
(
'autodll-webpack-plugin/lib/paths'
)
autoDllWebpackPluginPaths
.
cacheDir
=
autodllCachePath
autoDllWebpackPluginPaths
.
getManifestPath
=
hash
=>
bundleName
=>
path
.
resolve
(
autodllCachePath
,
hash
,
`
${
bundleName
}
.manifest.json`
)
return
require
(
'autodll-webpack-plugin'
)
}
packages/next/build/webpack-config.ts
View file @
40f6bdef
...
...
@@ -34,7 +34,6 @@ import { pluginLoaderOptions } from './webpack/loaders/next-plugin-loader'
import
BuildManifestPlugin
from
'./webpack/plugins/build-manifest-plugin'
import
ChunkNamesPlugin
from
'./webpack/plugins/chunk-names-plugin'
import
{
CssMinimizerPlugin
}
from
'./webpack/plugins/css-minimizer-plugin'
import
{
importAutoDllPlugin
}
from
'./webpack/plugins/dll-import'
import
{
DropClientPage
}
from
'./webpack/plugins/next-drop-client-page-plugin'
import
NextEsmPlugin
from
'./webpack/plugins/next-esm-plugin'
import
NextJsSsrImportPlugin
from
'./webpack/plugins/nextjs-ssr-import'
...
...
@@ -813,7 +812,9 @@ export default async function getBaseWebpackConfig(
]
if
(
!
isServer
)
{
const
AutoDllPlugin
=
importAutoDllPlugin
({
distDir
})
const
AutoDllPlugin
=
require
(
'next/dist/compiled/autodll-webpack-plugin'
)(
distDir
)
devPlugins
.
push
(
new
AutoDllPlugin
({
filename
:
'[name]_[hash].js'
,
...
...
packages/next/build/webpack/plugins/dll-import.ts
deleted
100644 → 0
View file @
8b1ea308
import
path
from
'path'
export
function
importAutoDllPlugin
({
distDir
}:
{
distDir
:
string
})
{
const
autodllPaths
=
path
.
join
(
path
.
dirname
(
require
.
resolve
(
'autodll-webpack-plugin'
)),
'paths.js'
)
require
(
autodllPaths
)
const
autodllCachePath
=
path
.
resolve
(
path
.
join
(
distDir
,
'cache'
,
'autodll-webpack-plugin'
)
)
require
.
cache
[
autodllPaths
]
=
Object
.
assign
({},
require
.
cache
[
autodllPaths
],
{
exports
:
Object
.
assign
({},
require
.
cache
[
autodllPaths
].
exports
,
{
cacheDir
:
autodllCachePath
,
getManifestPath
:
(
hash
:
string
)
=>
(
bundleName
:
string
)
=>
path
.
resolve
(
autodllCachePath
,
hash
,
`
${
bundleName
}
.manifest.json`
),
}),
})
const
AutoDllPlugin
=
require
(
'autodll-webpack-plugin'
)
return
AutoDllPlugin
}
packages/next/package.json
View file @
40f6bdef
...
...
@@ -74,7 +74,6 @@
"@babel/preset-typescript"
:
"7.7.2"
,
"@babel/runtime"
:
"7.7.2"
,
"@babel/types"
:
"7.7.4"
,
"autodll-webpack-plugin"
:
"0.4.2"
,
"babel-loader"
:
"8.0.6"
,
"babel-plugin-dynamic-import-node"
:
"2.3.0"
,
"babel-plugin-syntax-jsx"
:
"6.18.0"
,
...
...
@@ -157,6 +156,7 @@
"ast-types"
:
"0.13.2"
,
"async-retry"
:
"1.2.3"
,
"async-sema"
:
"3.0.0"
,
"autodll-webpack-plugin"
:
"0.4.2"
,
"chalk"
:
"2.4.2"
,
"ci-info"
:
"2.0.0"
,
"compression"
:
"1.7.4"
,
...
...
packages/next/taskfile.js
View file @
40f6bdef
...
...
@@ -77,6 +77,15 @@ export async function ncc_async_sema(task, opts) {
.
target
(
'dist/compiled/async-sema'
)
}
// eslint-disable-next-line camelcase
externals
[
'autodll-webpack-plugin'
]
=
'next/dist/compiled/autodll-webpack-plugin'
export
async
function
ncc_autodll_webpack_plugin
(
task
,
opts
)
{
await
task
.
source
(
opts
.
src
||
'build/bundles/autodll-webpack-plugin.js'
)
.
ncc
({
packageName
:
'autodll-webpack-plugin'
,
externals
})
.
target
(
'dist/compiled/autodll-webpack-plugin'
)
}
// eslint-disable-next-line camelcase
// NB: Used by other dependencies, but Zeit version is a duplicate
// version so can be inlined anyway (although may change in future)
externals
[
'chalk'
]
=
'next/dist/compiled/chalk'
...
...
@@ -408,6 +417,7 @@ export async function precompile(task) {
'ncc_arg'
,
'ncc_async_retry'
,
'ncc_async_sema'
,
'ncc_autodll_webpack_plugin'
,
'ncc_chalk'
,
'ncc_ci_info'
,
'ncc_compression'
,
...
...
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