Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
34416dd6
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
723
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
34416dd6
编写于
8月 04, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: sync from origin
a2b89d3c44011e9c8c4af523a8d7039d9b27705c
上级
85250e38
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
11 deletion
+10
-11
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
+10
-11
未找到文件。
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
浏览文件 @
34416dd6
...
@@ -49,7 +49,7 @@ module.exports = function (source) {
...
@@ -49,7 +49,7 @@ module.exports = function (source) {
sourceMap
,
sourceMap
,
rootContext
,
rootContext
,
resourcePath
,
resourcePath
,
resourceQuery
resourceQuery
=
''
}
=
loaderContext
}
=
loaderContext
const
rawQuery
=
resourceQuery
.
slice
(
1
)
const
rawQuery
=
resourceQuery
.
slice
(
1
)
...
@@ -79,20 +79,20 @@ module.exports = function (source) {
...
@@ -79,20 +79,20 @@ module.exports = function (source) {
const
isWin
=
/^win/
.
test
(
process
.
platform
)
const
isWin
=
/^win/
.
test
(
process
.
platform
)
const
normalizePath
=
path
=>
(
isWin
?
path
.
replace
(
/
\\
/g
,
'
/
'
)
:
path
)
const
normalizePath
=
path
=>
(
isWin
?
path
.
replace
(
/
\\
/g
,
'
/
'
)
:
path
)
if
(
!
options
.
compilerOptions
)
{
if
(
!
options
.
compilerOptions
)
{
options
.
compilerOptions
=
{}
options
.
compilerOptions
=
{}
}
}
options
.
compilerOptions
.
autoComponentResourcePath
=
normalizePath
(
resourcePath
)
options
.
compilerOptions
.
autoComponentResourcePath
=
normalizePath
(
resourcePath
)
// fixed by xxxxxx
// fixed by xxxxxx
if
(
!
modules
&&
options
.
compilerOptions
&&
options
.
compilerOptions
.
modules
)
{
if
(
!
modules
&&
options
.
compilerOptions
&&
options
.
compilerOptions
.
modules
)
{
modules
=
options
.
compilerOptions
.
modules
modules
=
options
.
compilerOptions
.
modules
}
}
const
sourcePath
=
normalizePath
(
require
(
'
@dcloudio/uni-h5/path
'
).
src
)
const
sourcePath
=
normalizePath
(
require
(
'
@dcloudio/uni-h5/path
'
).
src
)
if
(
normalizePath
(
this
.
resourcePath
).
indexOf
(
sourcePath
)
===
0
)
{
if
(
normalizePath
(
this
.
resourcePath
).
indexOf
(
sourcePath
)
===
0
)
{
descriptor
.
styles
.
length
=
0
descriptor
.
styles
.
length
=
0
options
.
compilerOptions
&&
(
delete
options
.
compilerOptions
.
modules
)
options
.
compilerOptions
&&
(
delete
options
.
compilerOptions
.
modules
)
}
else
if
(
options
.
compilerOptions
)
{
}
else
if
(
options
.
compilerOptions
)
{
options
.
compilerOptions
.
modules
=
modules
options
.
compilerOptions
.
modules
=
modules
}
}
}
}
...
@@ -118,7 +118,7 @@ module.exports = function (source) {
...
@@ -118,7 +118,7 @@ module.exports = function (source) {
const
id
=
hash
(
const
id
=
hash
(
isProduction
isProduction
?
(
shortFilePath
+
'
\n
'
+
source
)
?
shortFilePath
+
'
\n
'
+
source
.
replace
(
/
\r\n
/g
,
'
\n
'
)
:
shortFilePath
:
shortFilePath
)
)
...
@@ -164,7 +164,7 @@ module.exports = function (source) {
...
@@ -164,7 +164,7 @@ module.exports = function (source) {
}
}
let
renderjsImport
=
`var renderjs`
let
renderjsImport
=
`var renderjs`
if
((
options
.
isAppView
||
options
.
isH5
)
&&
descriptor
.
renderjs
)
{
if
((
options
.
isAppView
||
options
.
isH5
)
&&
descriptor
.
renderjs
)
{
const
src
=
descriptor
.
renderjs
.
src
||
resourcePath
const
src
=
descriptor
.
renderjs
.
src
||
resourcePath
const
attrsQuery
=
attrsToQuery
(
descriptor
.
renderjs
.
attrs
,
'
js
'
)
const
attrsQuery
=
attrsToQuery
(
descriptor
.
renderjs
.
attrs
,
'
js
'
)
const
query
=
`?vue&type=renderjs
${
attrsQuery
}${
inheritQuery
}
`
const
query
=
`?vue&type=renderjs
${
attrsQuery
}${
inheritQuery
}
`
...
@@ -205,7 +205,7 @@ var component = normalizer(
...
@@ -205,7 +205,7 @@ var component = normalizer(
render,
render,
staticRenderFns,
staticRenderFns,
${
hasFunctional
?
`true`
:
`false`
}
,
${
hasFunctional
?
`true`
:
`false`
}
,
${
options
.
isAppNVue
?
`null`
:
(
/injectStyles/
.
test
(
stylesCode
)
?
`injectStyles`
:
`null`
)}
,
${
options
.
isAppNVue
?
`null`
:
(
/injectStyles/
.
test
(
stylesCode
)
?
`injectStyles`
:
`null`
)}
,
${
hasScoped
?
JSON
.
stringify
(
id
)
:
`null`
}
,
${
hasScoped
?
JSON
.
stringify
(
id
)
:
`null`
}
,
${
isServer
?
JSON
.
stringify
(
hash
(
request
))
:
`null`
}
,
${
isServer
?
JSON
.
stringify
(
hash
(
request
))
:
`null`
}
,
${
isShadow
?
`true`
:
`false`
}
,
${
isShadow
?
`true`
:
`false`
}
,
...
@@ -228,7 +228,7 @@ var component = normalizer(
...
@@ -228,7 +228,7 @@ var component = normalizer(
}
}
// fixed by xxxxxx (app-nvue injectStyles)
// fixed by xxxxxx (app-nvue injectStyles)
if
(
options
.
isAppNVue
&&
/injectStyles/
.
test
(
stylesCode
))
{
if
(
options
.
isAppNVue
&&
/injectStyles/
.
test
(
stylesCode
))
{
code
+=
`\ninjectStyles.call(component)`
code
+=
`\ninjectStyles.call(component)`
}
}
// Expose filename. This is used by the devtools and Vue runtime warnings.
// Expose filename. This is used by the devtools and Vue runtime warnings.
if
(
!
isProduction
)
{
if
(
!
isProduction
)
{
...
@@ -236,7 +236,7 @@ var component = normalizer(
...
@@ -236,7 +236,7 @@ var component = normalizer(
// from the devtools.
// from the devtools.
code
+=
`\ncomponent.options.__file =
${
JSON
.
stringify
(
rawShortFilePath
.
replace
(
/
\\
/g
,
'
/
'
))}
`
code
+=
`\ncomponent.options.__file =
${
JSON
.
stringify
(
rawShortFilePath
.
replace
(
/
\\
/g
,
'
/
'
))}
`
}
else
if
(
options
.
exposeFilename
)
{
}
else
if
(
options
.
exposeFilename
)
{
// Libraies can opt-in to expose their components' filenames in production builds.
// Libra
r
ies can opt-in to expose their components' filenames in production builds.
// For security reasons, only expose the file's basename in production.
// For security reasons, only expose the file's basename in production.
code
+=
`\ncomponent.options.__file =
${
JSON
.
stringify
(
filename
)}
`
code
+=
`\ncomponent.options.__file =
${
JSON
.
stringify
(
filename
)}
`
}
}
...
@@ -244,7 +244,6 @@ var component = normalizer(
...
@@ -244,7 +244,6 @@ var component = normalizer(
code
+=
`\nrecyclableRender && (component.options["@render"] = recyclableRender)`
// fixed by xxxxxx
code
+=
`\nrecyclableRender && (component.options["@render"] = recyclableRender)`
// fixed by xxxxxx
}
}
code
+=
`\nexport default component.exports`
code
+=
`\nexport default component.exports`
// console.log(code)
return
code
return
code
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录