Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
3e8cf51e
U
uni-app
项目概览
MuGuiLin
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3e8cf51e
编写于
8月 09, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: remove resolveComponent warning
上级
24dfc6f6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
74 addition
and
44 deletion
+74
-44
packages/uni-app-vite/dist/plugins/renderjs.js
packages/uni-app-vite/dist/plugins/renderjs.js
+31
-0
packages/uni-app-vite/dist/plugins/template.js
packages/uni-app-vite/dist/plugins/template.js
+7
-10
packages/uni-app-vite/src/plugins/template.ts
packages/uni-app-vite/src/plugins/template.ts
+14
-19
packages/uni-cli-shared/src/renderjs.ts
packages/uni-cli-shared/src/renderjs.ts
+7
-2
packages/vite-plugin-uni/src/cli/action.ts
packages/vite-plugin-uni/src/cli/action.ts
+5
-1
packages/vite-plugin-uni/src/cli/build.ts
packages/vite-plugin-uni/src/cli/build.ts
+0
-12
packages/vite-plugin-uni/src/config/build.ts
packages/vite-plugin-uni/src/config/build.ts
+10
-0
未找到文件。
packages/uni-app-vite/dist/plugins/renderjs.js
0 → 100644
浏览文件 @
3e8cf51e
"
use strict
"
;
var
__importDefault
=
(
this
&&
this
.
__importDefault
)
||
function
(
mod
)
{
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"
default
"
:
mod
};
};
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
uniRenderjsPlugin
=
void
0
;
const
debug_1
=
__importDefault
(
require
(
"
debug
"
));
const
uni_cli_shared_1
=
require
(
"
@dcloudio/uni-cli-shared
"
);
const
debugRenderjs
=
debug_1
.
default
(
'
vite:uni:renderjs
'
);
function
uniRenderjsPlugin
()
{
return
{
name
:
'
vite:uni-app-renderjs
'
,
transform
(
code
,
id
)
{
const
{
type
,
name
}
=
uni_cli_shared_1
.
parseRenderjs
(
id
);
if
(
!
type
)
{
return
;
}
debugRenderjs
(
id
);
if
(
!
name
)
{
this
.
error
(
uni_cli_shared_1
.
missingModuleName
(
type
,
code
));
}
this
.
emitFile
({
fileName
:
'
.renderjs.js
'
,
type
:
'
asset
'
,
source
:
code
,
});
return
''
;
},
};
}
exports
.
uniRenderjsPlugin
=
uniRenderjsPlugin
;
packages/uni-app-vite/dist/plugins/template.js
浏览文件 @
3e8cf51e
...
...
@@ -25,16 +25,13 @@ function uniTemplatePlugin() {
name
:
'
vite:uni-app-template
'
,
configResolved
()
{
const
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
;
return
Promise
.
all
([
fs_extra_1
.
default
.
copy
(
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/uni-app-view.umd.js
'
),
path_1
.
default
.
resolve
(
outputDir
,
'
uni-app-view.umd.js
'
),
{
overwrite
:
true
,
}),
fs_extra_1
.
default
.
copy
(
path_1
.
default
.
resolve
(
__dirname
,
'
../../lib/template/
'
),
outputDir
,
{
overwrite
:
true
,
})
.
then
(()
=>
fs_extra_1
.
default
.
writeFile
(
path_1
.
default
.
resolve
(
outputDir
,
'
__uniappview.html
'
),
genViewHtml
())),
]).
then
(()
=>
{
});
fs_extra_1
.
default
.
copySync
(
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/uni-app-view.umd.js
'
),
path_1
.
default
.
resolve
(
outputDir
,
'
uni-app-view.umd.js
'
),
{
overwrite
:
true
,
});
fs_extra_1
.
default
.
copySync
(
path_1
.
default
.
resolve
(
__dirname
,
'
../../lib/template/
'
),
outputDir
,
{
overwrite
:
true
,
});
fs_extra_1
.
default
.
writeFileSync
(
path_1
.
default
.
resolve
(
outputDir
,
'
__uniappview.html
'
),
genViewHtml
());
},
};
}
...
...
packages/uni-app-vite/src/plugins/template.ts
浏览文件 @
3e8cf51e
...
...
@@ -32,25 +32,20 @@ export function uniTemplatePlugin(): Plugin {
name
:
'
vite:uni-app-template
'
,
configResolved
()
{
const
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
return
Promise
.
all
([
fs
.
copy
(
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/uni-app-view.umd.js
'
),
path
.
resolve
(
outputDir
,
'
uni-app-view.umd.js
'
),
{
overwrite
:
true
,
}
),
fs
.
copy
(
path
.
resolve
(
__dirname
,
'
../../lib/template/
'
),
outputDir
,
{
overwrite
:
true
,
})
.
then
(()
=>
fs
.
writeFile
(
path
.
resolve
(
outputDir
,
'
__uniappview.html
'
),
genViewHtml
()
)
),
]).
then
(()
=>
{})
fs
.
copySync
(
require
.
resolve
(
'
@dcloudio/uni-app-plus/dist/uni-app-view.umd.js
'
),
path
.
resolve
(
outputDir
,
'
uni-app-view.umd.js
'
),
{
overwrite
:
true
,
}
)
fs
.
copySync
(
path
.
resolve
(
__dirname
,
'
../../lib/template/
'
),
outputDir
,
{
overwrite
:
true
,
})
fs
.
writeFileSync
(
path
.
resolve
(
outputDir
,
'
__uniappview.html
'
),
genViewHtml
()
)
},
}
}
packages/uni-cli-shared/src/renderjs.ts
浏览文件 @
3e8cf51e
...
...
@@ -12,20 +12,25 @@ export function isRenderjs(id: string) {
export
function
parseRenderjs
(
id
:
string
)
{
if
(
isWxs
(
id
))
{
const
{
query
,
filename
}
=
parseVueRequest
(
id
)
return
{
type
:
'
wxs
'
,
name
:
(
parseVueRequest
(
id
).
query
as
any
).
name
as
string
,
name
:
(
query
as
any
).
name
as
string
,
filename
,
}
as
const
}
if
(
isRenderjs
(
id
))
{
const
{
query
,
filename
}
=
parseVueRequest
(
id
)
return
{
type
:
'
renderjs
'
,
name
:
(
parseVueRequest
(
id
).
query
as
any
).
name
as
string
,
name
:
(
query
as
any
).
name
as
string
,
filename
,
}
as
const
}
return
{
type
:
''
,
name
:
''
,
filename
:
''
,
}
as
const
}
...
...
packages/vite-plugin-uni/src/cli/action.ts
浏览文件 @
3e8cf51e
...
...
@@ -26,7 +26,11 @@ export async function runDev(options: CliOptions & ServerOptions) {
})
}
}
catch
(
e
)
{
console
.
error
(
`error when starting dev server:\n
${
e
.
stack
||
e
}
`
)
if
(
options
.
platform
===
'
h5
'
)
{
console
.
error
(
`error when starting dev server:\n
${
e
.
stack
||
e
}
`
)
}
else
{
console
.
error
(
`error during build:\n
${
e
.
stack
||
e
}
`
)
}
process
.
exit
(
1
)
}
}
...
...
packages/vite-plugin-uni/src/cli/build.ts
浏览文件 @
3e8cf51e
...
...
@@ -31,18 +31,6 @@ export async function buildSSR(options: CliOptions) {
'
entry-server.js
'
)
ssrBuildServerOptions
.
outDir
=
process
.
env
.
UNI_OUTPUT_DIR
ssrBuildServerOptions
.
rollupOptions
=
{
onwarn
(
warning
,
warn
)
{
if
(
warning
.
code
===
'
UNUSED_EXTERNAL_IMPORT
'
)
{
const
{
message
}
=
warning
// ignore
if
(
message
.
includes
(
'
"resolveComponent"
'
))
{
return
}
}
warn
(
warning
)
},
}
process
.
env
.
UNI_SSR_CLIENT
=
''
process
.
env
.
UNI_SSR_SERVER
=
'
true
'
await
buildByVite
(
...
...
packages/vite-plugin-uni/src/config/build.ts
浏览文件 @
3e8cf51e
...
...
@@ -9,6 +9,16 @@ export function createBuild(
initEasycomsOnce
(
options
.
inputDir
,
options
.
platform
)
return
{
rollupOptions
:
{
onwarn
(
warning
,
warn
)
{
if
(
warning
.
code
===
'
UNUSED_EXTERNAL_IMPORT
'
)
{
const
{
message
}
=
warning
// ignore
if
(
message
.
includes
(
'
"resolveComponent"
'
))
{
return
}
}
warn
(
warning
)
},
output
:
{
chunkFileNames
(
chunkInfo
)
{
if
(
chunkInfo
.
facadeModuleId
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录