Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
next.js
提交
40f6bdef
N
next.js
项目概览
CoCo_Code_Op2
/
next.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
next.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
40f6bdef
编写于
3月 29, 2020
作者:
G
Guy Bedford
提交者:
Joe Haddad
3月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
autodll-webpack-plugin
上级
8b1ea308
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
26 deletion
+28
-26
packages/next/build/bundles/autodll-webpack-plugin.js
packages/next/build/bundles/autodll-webpack-plugin.js
+14
-0
packages/next/build/webpack-config.ts
packages/next/build/webpack-config.ts
+3
-2
packages/next/build/webpack/plugins/dll-import.ts
packages/next/build/webpack/plugins/dll-import.ts
+0
-23
packages/next/package.json
packages/next/package.json
+1
-1
packages/next/taskfile.js
packages/next/taskfile.js
+10
-0
未找到文件。
packages/next/build/bundles/autodll-webpack-plugin.js
0 → 100644
浏览文件 @
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
浏览文件 @
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
已删除
100644 → 0
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录