Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzb_79
uni-app
提交
af107bdd
U
uni-app
项目概览
lzb_79
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
af107bdd
编写于
5月 12, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(easycom): windows
上级
f6245c85
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
718 addition
and
714 deletion
+718
-714
.github/workflows/e2e.yml
.github/workflows/e2e.yml
+2
-14
.github/workflows/size-check.yml
.github/workflows/size-check.yml
+1
-1
package.json
package.json
+1
-0
packages/uni-cli-shared/src/api.ts
packages/uni-cli-shared/src/api.ts
+11
-0
packages/uni-cli-shared/src/constants.ts
packages/uni-cli-shared/src/constants.ts
+5
-0
packages/uni-cli-shared/src/index.ts
packages/uni-cli-shared/src/index.ts
+1
-0
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+311
-311
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+355
-355
packages/vite-plugin-uni/src/configResolved/plugins/easycom.ts
...ges/vite-plugin-uni/src/configResolved/plugins/easycom.ts
+6
-6
packages/vite-plugin-uni/src/configResolved/plugins/index.ts
packages/vite-plugin-uni/src/configResolved/plugins/index.ts
+8
-12
packages/vite-plugin-uni/src/configResolved/plugins/pagesJson.ts
...s/vite-plugin-uni/src/configResolved/plugins/pagesJson.ts
+15
-9
packages/vite-plugin-uni/src/utils/constants.ts
packages/vite-plugin-uni/src/utils/constants.ts
+0
-5
packages/vite-plugin-uni/src/utils/easycom.ts
packages/vite-plugin-uni/src/utils/easycom.ts
+2
-1
未找到文件。
.github/workflows/e2e.yml
浏览文件 @
af107bdd
...
...
@@ -44,7 +44,7 @@ jobs:
run
:
yarn install --frozen-lockfile
-
name
:
Build
run
:
npm run build
uni-app uni-cli-shared uni-h5 uni-i18n uni-shared vite-plugin-uni
run
:
npm run build
:h5
-
name
:
Install ssr and verify Cypress
working-directory
:
./packages/playground/ssr
...
...
@@ -56,16 +56,4 @@ jobs:
npx cypress version --component package
npx cypress version --component binary
npx cypress version --component electron
npx cypress version --component node
-
name
:
Cypress run
uses
:
cypress-io/github-action@v2.3.6
with
:
install
:
false
start
:
npm run dev:ssr
working-directory
:
./packages/playground/ssr
wait-on
:
'
http://localhost:3000'
wait-on-timeout
:
120
browser
:
chrome
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
npx cypress version --component node
\ No newline at end of file
.github/workflows/size-check.yml
浏览文件 @
af107bdd
...
...
@@ -31,6 +31,6 @@ jobs:
-
uses
:
fxy060608/size-check-action@v1.1.3
with
:
github_token
:
${{ secrets.GITHUB_TOKEN }}
build_script
:
build
build_script
:
build
:h5
files
:
packages/size-check/dist/size-check.es.js packages/size-check/dist/style.css packages/uni-app/dist/uni-app.es.js packages/uni-h5-vue/dist/vue.runtime.esm.js packages/uni-mp-vue/dist/vue.runtime.esm.js packages/uni-mp-alipay/dist/uni.api.esm.js packages/uni-mp-alipay/dist/uni.mp.esm.js packages/uni-mp-baidu/dist/uni.api.esm.js packages/uni-mp-baidu/dist/uni.mp.esm.js packages/uni-mp-qq/dist/uni.api.esm.js packages/uni-mp-qq/dist/uni.mp.esm.js packages/uni-mp-toutiao/dist/uni.api.esm.js packages/uni-mp-toutiao/dist/uni.mp.esm.js packages/uni-mp-weixin/dist/uni.api.esm.js packages/uni-mp-weixin/dist/uni.mp.esm.js packages/uni-quickapp-webview/dist/uni.api.esm.js packages/uni-quickapp-webview/dist/uni.mp.esm.js
-
run
:
npm run test
package.json
浏览文件 @
af107bdd
...
...
@@ -6,6 +6,7 @@
],
"scripts"
:
{
"build"
:
"node scripts/build.js"
,
"build:h5"
:
"node scripts/build.js uni-app uni-cli-shared uni-h5 uni-i18n uni-shared vite-plugin-uni"
,
"size"
:
"npm run build size-check"
,
"lint"
:
"eslint packages/*/src/**/*.ts"
,
"format"
:
"prettier --write --parser typescript
\"
packages/**/*.ts?(x)
\"
"
,
...
...
packages/uni-cli-shared/src/api.ts
0 → 100644
浏览文件 @
af107bdd
import
{
BASE_COMPONENTS_STYLE_PATH
,
H5_API_STYLE_PATH
}
from
'
./constants
'
export
const
API_STYLES
=
{
showModal
:
[
`
${
H5_API_STYLE_PATH
}
/modal.css`
],
showToast
:
[
`
${
H5_API_STYLE_PATH
}
/toast.css`
],
showActionSheet
:
[
`
${
H5_API_STYLE_PATH
}
/action-sheet.css`
],
previewImage
:
[
`
${
BASE_COMPONENTS_STYLE_PATH
}
/swiper.css`
,
`
${
BASE_COMPONENTS_STYLE_PATH
}
/swiper-item.css`
,
],
}
packages/uni-cli-shared/src/constants.ts
浏览文件 @
af107bdd
export
const
PUBLIC_DIR
=
'
static
'
export
const
EXTNAME_JS
=
[
'
.js
'
,
'
.ts
'
]
export
const
EXTNAME_VUE
=
[
'
.vue
'
,
'
.nvue
'
,
'
.fvue
'
]
export
const
H5_API_STYLE_PATH
=
'
@dcloudio/uni-h5/style/api/
'
export
const
H5_FRAMEWORK_STYLE_PATH
=
'
@dcloudio/uni-h5/style/framework/
'
export
const
H5_COMPONENTS_STYLE_PATH
=
'
@dcloudio/uni-h5/style/
'
export
const
BASE_COMPONENTS_STYLE_PATH
=
'
@dcloudio/uni-components/style/
'
packages/uni-cli-shared/src/index.ts
浏览文件 @
af107bdd
export
*
from
'
./api
'
export
*
from
'
./ssr
'
export
*
from
'
./uni
'
export
*
from
'
./url
'
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
af107bdd
此差异已折叠。
点击以展开。
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
af107bdd
此差异已折叠。
点击以展开。
packages/vite-plugin-uni/src/configResolved/plugins/easycom.ts
浏览文件 @
af107bdd
...
...
@@ -4,15 +4,15 @@ import { createFilter } from '@rollup/pluginutils'
import
{
camelize
,
capitalize
}
from
'
@vue/shared
'
import
{
isBuiltInComponent
}
from
'
@dcloudio/uni-shared
'
import
{
EXTNAME_VUE
,
parseVueRequest
}
from
'
@dcloudio/uni-cli-shared
'
import
{
UniPluginFilterOptions
}
from
'
.
'
import
{
EXTNAME_VUE
,
H5_COMPONENTS_STYLE_PATH
,
BASE_COMPONENTS_STYLE_PATH
,
debugEasycom
,
matchEasycom
,
}
from
'
../../utils
'
parseVueRequest
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
UniPluginFilterOptions
}
from
'
.
'
import
{
debugEasycom
,
matchEasycom
}
from
'
../../utils
'
const
H5_COMPONENTS_PATH
=
'
@dcloudio/uni-h5
'
...
...
packages/vite-plugin-uni/src/configResolved/plugins/index.ts
浏览文件 @
af107bdd
...
...
@@ -2,6 +2,7 @@ import debug from 'debug'
import
{
extend
}
from
'
@vue/shared
'
import
{
Plugin
,
ResolvedConfig
}
from
'
vite
'
import
{
FilterPattern
}
from
'
@rollup/pluginutils
'
import
{
API_STYLES
}
from
'
@dcloudio/uni-cli-shared
'
import
{
VitePluginUniResolvedOptions
}
from
'
../..
'
import
{
uniPrePlugin
}
from
'
./pre
'
import
{
uniJsonPlugin
}
from
'
./json
'
...
...
@@ -58,12 +59,6 @@ const uniEasycomPluginOptions: Partial<UniPluginFilterOptions> = {
exclude
:
[
APP_VUE_RE
,
UNI_H5_RE
],
}
const
API_STYLES
=
{
showModal
:
'
modal
'
,
showToast
:
'
toast
'
,
showActionSheet
:
'
action-sheet
'
,
}
const
uniInjectPluginOptions
:
Partial
<
InjectOptions
>
=
{
exclude
:
[...
COMMON_EXCLUDE
],
'
uni.
'
:
'
@dcloudio/uni-h5
'
,
...
...
@@ -72,16 +67,17 @@ const uniInjectPluginOptions: Partial<InjectOptions> = {
UniServiceJSBridge
:
[
'
@dcloudio/uni-h5
'
,
'
UniServiceJSBridge
'
],
UniViewJSBridge
:
[
'
@dcloudio/uni-h5
'
,
'
UniViewJSBridge
'
],
callback
(
imports
,
mod
)
{
const
style
=
const
style
s
=
mod
[
0
]
===
'
@dcloudio/uni-h5
'
&&
API_STYLES
[
mod
[
1
]
as
keyof
typeof
API_STYLES
]
if
(
!
style
)
{
if
(
!
style
s
)
{
return
}
const
hash
=
`
${
mod
[
0
]}
.
${
mod
[
1
]}
`
if
(
!
imports
.
has
(
hash
))
{
imports
.
set
(
hash
,
`import '@dcloudio/uni-h5/style/api/
${
style
}
.css';`
)
}
styles
.
forEach
((
style
)
=>
{
if
(
!
imports
.
has
(
style
))
{
imports
.
set
(
style
,
`import '
${
style
}
';`
)
}
})
},
}
...
...
packages/vite-plugin-uni/src/configResolved/plugins/pagesJson.ts
浏览文件 @
af107bdd
...
...
@@ -4,14 +4,14 @@ import slash from 'slash'
import
{
Plugin
,
ResolvedConfig
}
from
'
vite
'
import
{
parse
}
from
'
jsonc-parser
'
import
{
camelize
,
capitalize
}
from
'
@vue/shared
'
import
{
normalizePagesJson
}
from
'
@dcloudio/uni-cli-shared
'
import
{
VitePluginUniResolvedOptions
}
from
'
../..
'
import
{
BASE_COMPONENTS_STYLE_PATH
,
FEATURE_DEFINES
,
H5_API_STYLE_PATH
,
H5_FRAMEWORK_STYLE_PATH
,
}
from
'
../../utils
'
BASE_COMPONENTS_STYLE_PATH
,
normalizePagesJson
,
API_STYLES
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
VitePluginUniResolvedOptions
}
from
'
../..
'
import
{
FEATURE_DEFINES
}
from
'
../../utils
'
const
pkg
=
require
(
'
@dcloudio/vite-plugin-uni/package.json
'
)
...
...
@@ -146,9 +146,15 @@ function generateCssCode(
cssFiles
.
push
(
BASE_COMPONENTS_STYLE_PATH
+
'
input.css
'
)
}
if
(
options
.
command
===
'
serve
'
)
{
cssFiles
.
push
(
H5_API_STYLE_PATH
+
'
modal.css
'
)
cssFiles
.
push
(
H5_API_STYLE_PATH
+
'
toast.css
'
)
cssFiles
.
push
(
H5_API_STYLE_PATH
+
'
action-sheet.css
'
)
// 开发模式,自动添加所有API相关css
Object
.
keys
(
API_STYLES
).
forEach
((
name
)
=>
{
const
styles
=
API_STYLES
[
name
as
keyof
typeof
API_STYLES
]
styles
.
forEach
((
style
)
=>
{
if
(
!
cssFiles
.
includes
(
style
))
{
cssFiles
.
push
(
style
)
}
})
})
}
return
cssFiles
.
map
((
file
)
=>
`import '
${
file
}
'`
).
join
(
'
\n
'
)
}
...
...
packages/vite-plugin-uni/src/utils/constants.ts
浏览文件 @
af107bdd
export
const
H5_API_STYLE_PATH
=
'
@dcloudio/uni-h5/style/api/
'
export
const
H5_FRAMEWORK_STYLE_PATH
=
'
@dcloudio/uni-h5/style/framework/
'
export
const
H5_COMPONENTS_STYLE_PATH
=
'
@dcloudio/uni-h5/style/
'
export
const
BASE_COMPONENTS_STYLE_PATH
=
'
@dcloudio/uni-components/style/
'
// 其实应该直接通过 mainFields 来识别
export
const
BUILT_IN_MODULES
=
{
'
vue-router
'
:
{
...
...
packages/vite-plugin-uni/src/utils/easycom.ts
浏览文件 @
af107bdd
import
fs
from
'
fs
'
import
path
from
'
path
'
import
debug
from
'
debug
'
import
slash
from
'
slash
'
import
{
createFilter
}
from
'
@rollup/pluginutils
'
...
...
@@ -171,7 +172,7 @@ function initAutoScanEasycom(
if
(
!
isDir
(
folder
))
{
return
}
const
importDir
=
path
.
relative
(
rootDir
,
folder
)
const
importDir
=
slash
(
path
.
relative
(
rootDir
,
folder
)
)
const
files
=
fs
.
readdirSync
(
folder
)
// 读取文件夹文件列表,比对文件名(fs.existsSync在大小写不敏感的系统会匹配不准确)
for
(
let
i
=
0
;
i
<
extensions
.
length
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录