Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ChenYFan_OHHH
uni-app
提交
5061f561
U
uni-app
项目概览
ChenYFan_OHHH
/
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,发现更多精彩内容 >>
提交
5061f561
编写于
3月 31, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stat): support uni-cloud-stat
上级
91f75d1e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
33 addition
and
22 deletion
+33
-22
packages/uni-cli-shared/lib/index.js
packages/uni-cli-shared/lib/index.js
+5
-3
packages/uni-cli-shared/lib/platform.js
packages/uni-cli-shared/lib/platform.js
+9
-2
packages/vue-cli-plugin-hbuilderx/packages/webpack-uni-nvue-loader/lib/main.js
...in-hbuilderx/packages/webpack-uni-nvue-loader/lib/main.js
+4
-3
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+3
-2
packages/vue-cli-plugin-uni/lib/configure-webpack.js
packages/vue-cli-plugin-uni/lib/configure-webpack.js
+0
-3
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+6
-5
packages/vue-cli-plugin-uni/lib/h5/index.js
packages/vue-cli-plugin-uni/lib/h5/index.js
+3
-2
packages/vue-cli-plugin-uni/lib/mp/index.js
packages/vue-cli-plugin-uni/lib/mp/index.js
+3
-2
未找到文件。
packages/uni-cli-shared/lib/index.js
浏览文件 @
5061f561
...
...
@@ -57,7 +57,8 @@ const {
nvueJsPreprocessOptions
,
nvueCssPreprocessOptions
,
nvueHtmlPreprocessOptions
,
getPlatformGlobal
getPlatformGlobal
,
getPlatformStat
}
=
require
(
'
./platform
'
)
module
.
exports
=
{
...
...
@@ -106,5 +107,6 @@ module.exports = {
nvueJsPreprocessOptions
,
nvueCssPreprocessOptions
,
nvueHtmlPreprocessOptions
,
getPlatformGlobal
}
getPlatformGlobal
,
getPlatformStat
}
packages/uni-cli-shared/lib/platform.js
浏览文件 @
5061f561
...
...
@@ -29,8 +29,8 @@ const cdns = {
'
mp-360
'
:
7
,
'
mp-dingtalk
'
:
8
,
'
mp-kuaishou
'
:
9
,
'
mp-lark
'
:
10
,
'
mp-jd
'
:
11
,
'
mp-lark
'
:
10
,
'
mp-jd
'
:
11
,
'
mp-xhs
'
:
12
,
'
quickapp-webview-huawei
'
:
200
,
'
quickapp-webview-union
'
:
201
...
...
@@ -159,6 +159,13 @@ module.exports = {
getPlatformSass
()
{
return
SASS
},
getPlatformStat
()
{
if
(
!
process
.
env
.
UNI_USING_STAT
)
{
return
''
}
return
process
.
env
.
UNI_USING_STAT
===
'
2
'
?
'
import
\'
@dcloudio/uni-stat/dist/uni-cloud-stat.es.js
\'
;
'
:
'
import
\'
@dcloudio/uni-stat/dist/uni-stat.es.js
\'
;
'
},
getBabelParserOptions
()
{
return
{
sourceType
:
'
module
'
,
...
...
packages/vue-cli-plugin-hbuilderx/packages/webpack-uni-nvue-loader/lib/main.js
浏览文件 @
5061f561
...
...
@@ -12,7 +12,8 @@ const {
}
=
require
(
'
vue-loader/lib/codegen/utils
'
)
const
{
normalizePath
normalizePath
,
getPlatformStat
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
appVuePath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
App.vue
'
)
...
...
@@ -47,7 +48,7 @@ module.exports = function (content, map) {
const
loaderContext
=
this
const
statCode
=
process
.
env
.
UNI_USING_STAT
?
'
import
\'
@dcloudio/uni-stat
\'
;
'
:
''
const
statCode
=
getPlatformStat
()
if
(
this
.
resourceQuery
)
{
const
params
=
loaderUtils
.
parseQuery
(
this
.
resourceQuery
)
...
...
@@ -88,4 +89,4 @@ module.exports = function (content, map) {
const
automatorCode
=
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
?
'
import
\'
@dcloudio/uni-app-plus/dist/automator
\'
;
'
:
''
return
automatorCode
+
statCode
+
content
}
}
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
5061f561
...
...
@@ -2,7 +2,8 @@ const path = require('path')
const
webpack
=
require
(
'
webpack
'
)
const
{
getMainEntry
getMainEntry
,
getPlatformStat
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
vueLoader
=
require
(
'
@dcloudio/uni-cli-shared/lib/vue-loader
'
)
...
...
@@ -58,7 +59,7 @@ const v3 = {
const
isAppService
=
!!
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
].
service
const
isAppView
=
!!
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
].
view
const
statCode
=
process
.
env
.
UNI_USING_STAT
?
'
import
\'
@dcloudio/uni-stat
\'
;
'
:
''
const
statCode
=
getPlatformStat
()
const
beforeCode
=
'
import
\'
uni-pages
\'
;
'
...
...
packages/vue-cli-plugin-uni/lib/configure-webpack.js
浏览文件 @
5061f561
...
...
@@ -323,9 +323,6 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
.
UNI_INPUT_DIR
),
// css中的'@/static/logo.png'会被转换成'./@/static/logo.png'加载
vue
$
:
getPlatformVue
(
vueOptions
),
'
uni-pages
'
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
pages.json
'
),
'
@dcloudio/uni-stat
'
:
process
.
env
.
UNI_USING_VUE3
?
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/uni-stat
'
)
:
require
.
resolve
(
'
@dcloudio/uni-stat
'
),
'
uni-stat-config
'
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
pages.json
'
)
+
'
?
'
+
JSON
.
stringify
({
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
5061f561
...
...
@@ -50,7 +50,8 @@ process.env.UNI_USING_V3_SCOPED = true
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
([])
// 导出到小程序插件
process
.
env
.
UNI_MP_PLUGIN_EXPORT
=
JSON
.
stringify
(
Object
.
keys
(
platformOptions
.
plugins
||
{}).
map
(
pluginName
=>
platformOptions
.
plugins
[
pluginName
].
export
))
process
.
env
.
UNI_MP_PLUGIN_EXPORT
=
JSON
.
stringify
(
Object
.
keys
(
platformOptions
.
plugins
||
{}).
map
(
pluginName
=>
platformOptions
.
plugins
[
pluginName
].
export
))
const
isH5
=
!
process
.
env
.
UNI_SUB_PLATFORM
&&
process
.
env
.
UNI_PLATFORM
===
'
h5
'
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
...
...
@@ -308,7 +309,7 @@ if (
)
if
(
uniStatistics
.
enable
===
true
)
{
process
.
env
.
UNI_USING_STAT
=
true
process
.
env
.
UNI_USING_STAT
=
uniStatistics
.
version
===
'
2
'
?
'
2
'
:
'
1
'
if
(
!
process
.
UNI_STAT_CONFIG
.
appid
&&
process
.
env
.
NODE_ENV
===
'
production
'
)
{
console
.
log
()
console
.
warn
(
uniI18n
.
__
(
'
pluginUni.uniStatisticsNoAppid
'
,
{
...
...
@@ -399,9 +400,9 @@ moduleAlias.addAlias('vue-template-compiler', '@dcloudio/vue-cli-plugin-uni/pack
moduleAlias
.
addAlias
(
'
@megalo/template-compiler
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/@megalo/template-compiler
'
)
moduleAlias
.
addAlias
(
'
mpvue-template-compiler
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/mpvue-template-compiler
'
)
// vue-loader
moduleAlias
.
addAlias
(
'
vue-loader
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader
'
)
moduleAlias
.
addAlias
(
'
vue-loader
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader
'
)
// sass-loader
moduleAlias
.
addAlias
(
'
sass-loader
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/sass-loader
'
)
moduleAlias
.
addAlias
(
'
sass-loader
'
,
'
@dcloudio/vue-cli-plugin-uni/packages/sass-loader
'
)
if
(
process
.
env
.
UNI_USING_V3
&&
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
)
{
moduleAlias
.
addAlias
(
'
./runtime/getUrl.js
'
,
'
@dcloudio/vue-cli-plugin-uni/lib/app-plus/getUrl.js
'
)
...
...
@@ -501,4 +502,4 @@ runByHBuilderX && console.log(uniI18n.__('compiling'))
module
.
exports
=
{
manifestPlatformOptions
:
platformOptions
}
}
packages/vue-cli-plugin-uni/lib/h5/index.js
浏览文件 @
5061f561
...
...
@@ -4,7 +4,8 @@ const webpack = require('webpack')
const
{
getMainEntry
,
getH5Options
getH5Options
,
getPlatformStat
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
{
...
...
@@ -91,7 +92,7 @@ module.exports = {
webpackConfig
(
webpackConfig
)
{
let
useBuiltIns
=
'
usage
'
const
statCode
=
process
.
env
.
UNI_USING_STAT
?
'
import
\'
@dcloudio/uni-stat
\'
;
'
:
''
const
statCode
=
getPlatformStat
()
try
{
const
babelConfig
=
require
(
path
.
resolve
(
process
.
env
.
UNI_CLI_CONTEXT
,
'
babel.config.js
'
))
...
...
packages/vue-cli-plugin-uni/lib/mp/index.js
浏览文件 @
5061f561
...
...
@@ -6,7 +6,8 @@ const {
getMainEntry
,
normalizePath
,
getPlatformExts
,
getPlatformCssnano
getPlatformCssnano
,
getPlatformStat
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
WebpackUniAppPlugin
=
require
(
'
../../packages/webpack-uni-app-loader/plugin/index
'
)
...
...
@@ -162,7 +163,7 @@ module.exports = {
parseEntry
()
const
statCode
=
process
.
env
.
UNI_USING_STAT
?
'
import
\'
@dcloudio/uni-stat
\'
;
'
:
''
const
statCode
=
getPlatformStat
()
let
beforeCode
=
'
import
\'
uni-pages
\'
;
'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录