Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
next.js
提交
57535b5a
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,发现更多精彩内容 >>
未验证
提交
57535b5a
编写于
5月 21, 2020
作者:
M
Maxi Gimenez
提交者:
GitHub
5月 21, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(next/build/babel): missing types (#13189)
上级
da5a05dc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
10 deletion
+10
-10
packages/next/build/babel/plugins/amp-attributes.ts
packages/next/build/babel/plugins/amp-attributes.ts
+1
-1
packages/next/build/babel/plugins/next-page-config.ts
packages/next/build/babel/plugins/next-page-config.ts
+2
-2
packages/next/build/babel/plugins/next-ssg-transform.ts
packages/next/build/babel/plugins/next-ssg-transform.ts
+6
-6
packages/next/build/babel/preset.ts
packages/next/build/babel/preset.ts
+1
-1
未找到文件。
packages/next/build/babel/plugins/amp-attributes.ts
浏览文件 @
57535b5a
import
{
NodePath
,
PluginObj
,
types
}
from
'
@babel/core
'
export
default
function
AmpAttributePatcher
(
...
args
:
any
):
PluginObj
{
export
default
function
AmpAttributePatcher
():
PluginObj
{
return
{
visitor
:
{
JSXOpeningElement
(
path
:
NodePath
<
types
.
JSXOpeningElement
>
)
{
...
...
packages/next/build/babel/plugins/next-page-config.ts
浏览文件 @
57535b5a
...
...
@@ -4,7 +4,7 @@ import { PageConfig } from 'next/types'
const
STRING_LITERAL_DROP_BUNDLE
=
'
__NEXT_DROP_CLIENT_FILE__
'
// replace program path with just a variable with the drop identifier
function
replaceBundle
(
path
:
any
,
t
:
typeof
BabelTypes
)
{
function
replaceBundle
(
path
:
any
,
t
:
typeof
BabelTypes
)
:
void
{
path
.
parentPath
.
replaceWith
(
t
.
program
(
[
...
...
@@ -24,7 +24,7 @@ function replaceBundle(path: any, t: typeof BabelTypes) {
)
}
function
errorMessage
(
state
:
any
,
details
:
string
)
{
function
errorMessage
(
state
:
any
,
details
:
string
)
:
string
{
const
pageName
=
(
state
.
filename
||
''
).
split
(
state
.
cwd
||
''
).
pop
()
||
'
unknown
'
return
`Invalid page config export found.
${
details
}
in file
${
pageName
}
. See: https://err.sh/zeit/next.js/invalid-page-config`
...
...
packages/next/build/babel/plugins/next-ssg-transform.ts
浏览文件 @
57535b5a
...
...
@@ -33,7 +33,7 @@ function decorateSsgExport(
t
:
typeof
BabelTypes
,
path
:
NodePath
<
BabelTypes
.
Program
>
,
state
:
PluginState
)
{
)
:
void
{
const
gsspName
=
state
.
isPrerender
?
STATIC_PROPS_ID
:
SERVER_PROPS_ID
const
gsspId
=
t
.
identifier
(
gsspName
)
...
...
@@ -41,7 +41,7 @@ function decorateSsgExport(
path
:
NodePath
<
BabelTypes
.
ExportDefaultDeclaration
|
BabelTypes
.
ExportNamedDeclaration
>
)
=>
{
)
:
void
=>
{
if
(
state
.
done
)
{
return
}
...
...
@@ -156,7 +156,7 @@ export default function nextTransformSsg({
|
BabelTypes
.
ArrowFunctionExpression
>
,
state
:
PluginState
)
{
)
:
void
{
const
ident
=
getIdentifier
(
path
)
if
(
ident
?.
node
&&
isIdentifierReferenced
(
ident
))
{
state
.
refs
.
add
(
ident
)
...
...
@@ -170,7 +170,7 @@ export default function nextTransformSsg({
|
BabelTypes
.
ImportNamespaceSpecifier
>
,
state
:
PluginState
)
{
)
:
void
{
const
local
=
path
.
get
(
'
local
'
)
if
(
isIdentifierReferenced
(
local
))
{
state
.
refs
.
add
(
local
)
...
...
@@ -314,7 +314,7 @@ export default function nextTransformSsg({
|
BabelTypes
.
FunctionExpression
|
BabelTypes
.
ArrowFunctionExpression
>
)
{
)
:
void
{
const
ident
=
getIdentifier
(
path
)
if
(
ident
?.
node
&&
...
...
@@ -340,7 +340,7 @@ export default function nextTransformSsg({
|
BabelTypes
.
ImportDefaultSpecifier
|
BabelTypes
.
ImportNamespaceSpecifier
>
)
{
)
:
void
{
const
local
=
path
.
get
(
'
local
'
)
if
(
refs
.
has
(
local
)
&&
!
isIdentifierReferenced
(
local
))
{
++
count
...
...
packages/next/build/babel/preset.ts
浏览文件 @
57535b5a
...
...
@@ -54,7 +54,7 @@ type BabelPreset = {
}
// Taken from https://github.com/babel/babel/commit/d60c5e1736543a6eac4b549553e107a9ba967051#diff-b4beead8ad9195361b4537601cc22532R158
function
supportsStaticESM
(
caller
:
any
)
{
function
supportsStaticESM
(
caller
:
any
)
:
boolean
{
return
!!
caller
?.
supportsStaticESM
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录