Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小浣熊撸代码
uni-app
提交
af39305e
U
uni-app
项目概览
小浣熊撸代码
/
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,发现更多精彩内容 >>
提交
af39305e
编写于
3月 11, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dcloudio/uni-app into dev
上级
f479c38f
552e4ed7
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
51 addition
and
92 deletion
+51
-92
packages/uni-cli-shared/lib/index.js
packages/uni-cli-shared/lib/index.js
+0
-2
packages/uni-cli-shared/lib/platform.js
packages/uni-cli-shared/lib/platform.js
+0
-35
packages/uni-cli-shared/lib/vue-loader.js
packages/uni-cli-shared/lib/vue-loader.js
+22
-0
packages/uni-quickapp/lib/chain-webpack.js
packages/uni-quickapp/lib/chain-webpack.js
+7
-12
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+7
-16
packages/vue-cli-plugin-uni/lib/h5/index.js
packages/vue-cli-plugin-uni/lib/h5/index.js
+8
-1
packages/vue-cli-plugin-uni/lib/mp.js
packages/vue-cli-plugin-uni/lib/mp.js
+2
-6
packages/vue-cli-plugin-uni/lib/vue-loader.js
packages/vue-cli-plugin-uni/lib/vue-loader.js
+5
-20
packages/webpack-uni-mp-loader/lib/plugin/compile-to-template.bak
.../webpack-uni-mp-loader/lib/plugin/compile-to-template.bak
+0
-0
packages/webpack-uni-mp-loader/lib/plugin/generate-components-wxml.bak
...ack-uni-mp-loader/lib/plugin/generate-components-wxml.bak
+0
-0
packages/webpack-uni-mp-loader/lib/plugin/generate-pages-wxml.bak
.../webpack-uni-mp-loader/lib/plugin/generate-pages-wxml.bak
+0
-0
packages/webpack-uni-mp-loader/lib/plugin/index.bak
packages/webpack-uni-mp-loader/lib/plugin/index.bak
+0
-0
未找到文件。
packages/uni-cli-shared/lib/index.js
浏览文件 @
af39305e
...
...
@@ -49,7 +49,6 @@ const {
getPlatformExts
,
getPlatformTarget
,
getPlatformVue
,
getPlatformCompiler
,
getShadowCss
,
getPlatformCssVars
,
getPlatformCssnano
,
...
...
@@ -99,7 +98,6 @@ module.exports = {
getShadowCss
,
getPlatformCssVars
,
getPlatformCssnano
,
getPlatformCompiler
,
getShadowTemplate
,
parsePagesJson
,
parseManifestJson
,
...
...
packages/uni-cli-shared/lib/platform.js
浏览文件 @
af39305e
...
...
@@ -11,12 +11,6 @@ const {
}
=
require
(
'
./scss
'
)
const
uniRuntime
=
'
@dcloudio/vue-cli-plugin-uni/packages/mp-vue
'
const
mpvueRuntime
=
'
@dcloudio/vue-cli-plugin-uni/packages/mpvue
'
const
megaloRuntime
=
'
@dcloudio/vue-cli-plugin-uni/packages/megalo
'
const
uniCompiler
=
'
@dcloudio/uni-template-compiler
'
const
mpvueCompiler
=
'
@dcloudio/vue-cli-plugin-uni/packages/mpvue-template-compiler
'
const
megaloCompiler
=
'
@megalo/template-compiler
'
function
getShadowCss
()
{
let
tagName
=
'
page
'
...
...
@@ -94,7 +88,6 @@ const PLATFORMS = {
exts
:
false
,
vue
:
'
@dcloudio/vue-cli-plugin-uni/packages/h5-vue
'
,
compiler
:
false
,
megalo
:
false
,
filterTag
:
'
wxs
'
,
subPackages
:
false
,
cssVars
:
{
...
...
@@ -149,9 +142,6 @@ const PLATFORMS = {
template
:
'
.wxml
'
,
filter
:
'
.wxs
'
},
vue
:
mpvueRuntime
,
compiler
:
mpvueCompiler
,
megalo
:
false
,
filterTag
:
'
wxs
'
,
subPackages
:
false
,
cssVars
:
{},
...
...
@@ -203,9 +193,6 @@ const PLATFORMS = {
template
:
'
.qml
'
,
filter
:
'
.wxs
'
},
vue
:
mpvueRuntime
,
compiler
:
mpvueCompiler
,
megalo
:
false
,
filterTag
:
'
wxs
'
,
subPackages
:
true
,
cssVars
:
{
...
...
@@ -230,9 +217,6 @@ const PLATFORMS = {
template
:
'
.wxml
'
,
filter
:
'
.wxs
'
},
vue
:
mpvueRuntime
,
compiler
:
mpvueCompiler
,
megalo
:
false
,
filterTag
:
'
wxs
'
,
subPackages
:
true
,
cssVars
:
{
...
...
@@ -267,9 +251,6 @@ const PLATFORMS = {
template
:
'
.swan
'
,
filter
:
'
.filter.js
'
},
vue
:
megaloRuntime
,
compiler
:
megaloCompiler
,
megalo
:
'
swan
'
,
filterTag
:
'
filter
'
,
subPackages
:
true
,
cssVars
:
{
...
...
@@ -294,9 +275,6 @@ const PLATFORMS = {
template
:
'
.axml
'
,
filter
:
'
.sjs
'
},
vue
:
megaloRuntime
,
compiler
:
megaloCompiler
,
megalo
:
'
alipay
'
,
filterTag
:
'
sjs
'
,
subPackages
:
true
,
cssVars
:
{
...
...
@@ -319,9 +297,6 @@ const PLATFORMS = {
style
:
'
.ttss
'
,
template
:
'
.ttml
'
},
vue
:
megaloRuntime
,
compiler
:
megaloCompiler
,
megalo
:
'
tt
'
,
subPackages
:
false
,
cssVars
:
{
'
--status-bar-height
'
:
'
25px
'
,
...
...
@@ -580,16 +555,6 @@ module.exports = {
}
return
platform
.
vue
},
getPlatformCompiler
()
{
if
(
process
.
env
.
UNI_USING_COMPONENTS
||
process
.
env
.
UNI_PLATFORM
===
'
h5
'
||
process
.
env
.
UNI_PLATFORM
===
'
quickapp
'
)
{
return
require
(
uniCompiler
)
}
return
require
(
platform
.
compiler
)
},
getPlatformCssVars
()
{
return
platform
.
cssVars
},
...
...
packages/uni-cli-shared/lib/vue-loader.js
0 → 100644
浏览文件 @
af39305e
const
defaultOptions
=
{
compiler
:
require
(
'
@dcloudio/uni-template-compiler
'
),
hotReload
:
false
,
cacheDirectory
:
false
,
cacheIdentifier
:
false
}
const
defaultCompilerOptions
=
{
preserveWhitespace
:
false
}
module
.
exports
=
{
test
:
[
/
\.
vue$/
,
/
\.
nvue$/
],
loader
:
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader
'
),
options
(
options
=
{},
compilerOptions
=
{})
{
return
Object
.
assign
({},
defaultOptions
,
options
,
{
compilerOptions
:
Object
.
assign
({},
defaultCompilerOptions
,
compilerOptions
)
})
}
}
packages/uni-quickapp/lib/chain-webpack.js
浏览文件 @
af39305e
const
vueLoader
=
require
(
'
@dcloudio/uni-cli-shared/lib/vue-loader
'
)
module
.
exports
=
config
=>
{
config
.
module
.
rule
(
'
vue
'
)
.
test
(
[
/
\.
vue$/
,
/
\.
nvue$/
]
)
.
test
(
vueLoader
.
test
)
.
use
(
'
vue-loader
'
)
.
loader
(
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader
'
))
.
tap
(
options
=>
Object
.
assign
(
options
,
{
compiler
:
require
(
'
@dcloudio/uni-template-compiler
'
),
compilerOptions
:
{
quickapp
:
true
,
preserveWhitespace
:
false
},
hotReload
:
false
,
cacheDirectory
:
false
,
cacheIdentifier
:
false
}))
.
loader
(
vueLoader
.
loader
)
.
tap
(
options
=>
Object
.
assign
(
options
,
vueLoader
.
options
({},
{
quickapp
:
true
,
})))
config
.
module
.
rule
(
'
vue
'
)
...
...
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
af39305e
...
...
@@ -7,6 +7,8 @@ const {
getPlatformCompiler
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
vueLoader
=
require
(
'
@dcloudio/uni-cli-shared/lib/vue-loader
'
)
const
{
getGlobalUsingComponentsCode
}
=
require
(
'
@dcloudio/uni-cli-shared/lib/pages
'
)
...
...
@@ -14,7 +16,6 @@ const {
const
WebpackUniAppPlugin
=
require
(
'
../../packages/webpack-uni-app-loader/plugin/index
'
)
const
{
isUnaryTag
,
getPartialIdentifier
}
=
require
(
'
../util
'
)
...
...
@@ -245,7 +246,6 @@ const v3 = {
}
const
compilerOptions
=
{
isUnaryTag
,
preserveWhitespace
:
false
,
service
:
isAppService
,
view
:
isAppView
...
...
@@ -254,23 +254,14 @@ const v3 = {
// disable vue cache-loader
webpackConfig
.
module
.
rule
(
'
vue
'
)
.
test
(
[
/
\.
vue$/
,
/
\.
nvue$/
]
)
.
test
(
vueLoader
.
test
)
.
use
(
'
vue-loader
'
)
// service 层移除 style 节点,view 层返回固定 script
.
loader
(
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader
'
)
)
.
tap
(
options
=>
Object
.
assign
(
options
,
{
.
loader
(
vueLoader
.
loader
)
.
tap
(
options
=>
Object
.
assign
(
options
,
vueLoader
.
options
(
{
isAppService
,
isAppView
,
compiler
:
getPlatformCompiler
(),
compilerOptions
},
cacheConfig
))
isAppView
},
compilerOptions
),
cacheConfig
))
.
end
()
// .use('uniapp-custom-block-loader')
// .loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader'))
// .options({
// isAppService,
// isAppView,
// compiler: getPlatformCompiler()
// })
// 是否启用 cache
if
(
process
.
env
.
UNI_USING_CACHE
)
{
...
...
packages/vue-cli-plugin-uni/lib/h5/index.js
浏览文件 @
af39305e
...
...
@@ -180,7 +180,14 @@ global.onAppShow = function(){};
webpackConfig
.
plugins
.
delete
(
'
preload-index
'
)
}
modifyVueLoader
(
webpackConfig
,
require
(
'
./compiler-options
'
),
api
)
modifyVueLoader
(
webpackConfig
,
{
isH5
:
true
,
hotReload
:
true
,
transformAssetUrls
:
{
'
v-uni-image
'
:
[
'
src
'
],
'
v-uni-cover-image
'
:
[
'
src
'
]
}
},
require
(
'
./compiler-options
'
),
api
)
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
require
(
'
./cssnano-options
'
)(
webpackConfig
)
...
...
packages/vue-cli-plugin-uni/lib/mp.js
浏览文件 @
af39305e
...
...
@@ -17,11 +17,7 @@ const {
}
=
require
(
'
./cache-loader
'
)
function
createUniMPPlugin
()
{
if
(
process
.
env
.
UNI_USING_COMPONENTS
)
{
const
WebpackUniMPPlugin
=
require
(
'
@dcloudio/webpack-uni-mp-loader/lib/plugin/index-new
'
)
return
new
WebpackUniMPPlugin
()
}
const
WebpackUniMPPlugin
=
require
(
'
@dcloudio/webpack-uni-mp-loader/lib/plugin
'
)
const
WebpackUniMPPlugin
=
require
(
'
@dcloudio/webpack-uni-mp-loader/lib/plugin/index-new
'
)
return
new
WebpackUniMPPlugin
()
}
...
...
@@ -181,7 +177,7 @@ module.exports = {
const
compilerOptions
=
process
.
env
.
UNI_USING_COMPONENTS
?
{}
:
require
(
'
./mp-compiler-options
'
)
modifyVueLoader
(
webpackConfig
,
compilerOptions
,
api
)
modifyVueLoader
(
webpackConfig
,
{},
compilerOptions
,
api
)
const
styleExt
=
getPlatformExts
().
style
...
...
packages/vue-cli-plugin-uni/lib/vue-loader.js
浏览文件 @
af39305e
const
{
getPlatformCompiler
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
vueLoader
=
require
(
'
@dcloudio/uni-cli-shared/lib/vue-loader
'
)
const
{
isUnaryTag
,
getPartialIdentifier
}
=
require
(
'
./util
'
)
module
.
exports
=
function
modifyVueLoader
(
webpackConfig
,
compilerOptions
,
api
)
{
module
.
exports
=
function
modifyVueLoader
(
webpackConfig
,
loaderOptions
,
compilerOptions
,
api
)
{
// vue-loader options
const
cacheConfig
=
{
...
...
@@ -24,23 +21,11 @@ module.exports = function modifyVueLoader (webpackConfig, compilerOptions, api)
webpackConfig
.
module
.
rule
(
'
vue
'
)
.
test
(
[
/
\.
vue$/
,
/
\.
nvue$/
]
)
.
test
(
vueLoader
.
test
)
.
use
(
'
vue-loader
'
)
.
loader
(
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader
'
))
.
tap
(
options
=>
Object
.
assign
(
options
,
{
isH5
:
process
.
env
.
UNI_PLATFORM
===
'
h5
'
,
compiler
:
getPlatformCompiler
(),
compilerOptions
:
Object
.
assign
({
isUnaryTag
,
preserveWhitespace
:
false
},
compilerOptions
)
},
cacheConfig
))
.
loader
(
vueLoader
.
loader
)
.
tap
(
options
=>
Object
.
assign
(
options
,
vueLoader
.
options
(
loaderOptions
,
compilerOptions
),
cacheConfig
))
.
end
()
// .use('uniapp-custom-block-loader')
// .loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader'))
// .options({
// compiler: getPlatformCompiler()
// })
// h5 框架需要使用 scoped 样式,其他平台编译时识别是否 nvue 文件且注入 flex 相关样式
if
(
process
.
env
.
UNI_PLATFORM
===
'
h5
'
)
{
...
...
packages/webpack-uni-mp-loader/lib/plugin/compile-to-template.
js
→
packages/webpack-uni-mp-loader/lib/plugin/compile-to-template.
bak
浏览文件 @
af39305e
文件已移动
packages/webpack-uni-mp-loader/lib/plugin/generate-components-wxml.
js
→
packages/webpack-uni-mp-loader/lib/plugin/generate-components-wxml.
bak
浏览文件 @
af39305e
文件已移动
packages/webpack-uni-mp-loader/lib/plugin/generate-pages-wxml.
js
→
packages/webpack-uni-mp-loader/lib/plugin/generate-pages-wxml.
bak
浏览文件 @
af39305e
文件已移动
packages/webpack-uni-mp-loader/lib/plugin/index.
js
→
packages/webpack-uni-mp-loader/lib/plugin/index.
bak
浏览文件 @
af39305e
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录