Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
genary
uni-app
提交
97144d70
U
uni-app
项目概览
genary
/
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,发现更多精彩内容 >>
提交
97144d70
编写于
4月 15, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build(deps): bump vite from 2.9.4 to 2.9.5
上级
22262739
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
67 addition
and
43 deletion
+67
-43
package.json
package.json
+1
-1
packages/playground/ssr/package.json
packages/playground/ssr/package.json
+1
-1
packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts
...ges/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts
+50
-26
packages/vite-plugin-uni/package.json
packages/vite-plugin-uni/package.json
+1
-1
pnpm-lock.yaml
pnpm-lock.yaml
+14
-14
未找到文件。
package.json
浏览文件 @
97144d70
...
...
@@ -84,7 +84,7 @@
"
semver
"
:
"
^7.3.5
"
,
"
ts-jest
"
:
"
^27.0.3
"
,
"
typescript
"
:
"
4.6.3
"
,
"
vite
"
:
"
^2.9.
4
"
,
"
vite
"
:
"
^2.9.
5
"
,
"
vue
"
:
"
3.2.33
"
,
"
vue-router
"
:
"
^4.0.14
"
,
"
yorkie
"
:
"
^2.0.0
"
...
...
packages/playground/ssr/package.json
浏览文件 @
97144d70
...
...
@@ -21,6 +21,6 @@
"compression"
:
"^1.7.4"
,
"cypress"
:
"^7.3.0"
,
"serve-static"
:
"^1.14.1"
,
"vite"
:
"^2.9.
4
"
"vite"
:
"^2.9.
5
"
}
}
packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts
浏览文件 @
97144d70
...
...
@@ -20,6 +20,7 @@ import { Plugin } from '../plugin'
import
{
ResolvedConfig
}
from
'
../config
'
import
{
ResolveFn
,
ViteDevServer
}
from
'
../
'
import
{
fileToUrl
,
assetUrlRE
,
getAssetFilename
}
from
'
./asset
'
import
MagicString
from
'
magic-string
'
import
*
as
Postcss
from
'
postcss
'
import
type
Sass
from
'
sass
'
// We need to disable check of extraneous import which is buggy for stylus,
...
...
@@ -288,6 +289,11 @@ export function cssPostPlugin(
)
)
})
// only external @imports and @charset should exist at this point
// hoist them to the top of the CSS chunk per spec (#1845 and #6333)
if
(
css
.
includes
(
'
@import
'
)
||
css
.
includes
(
'
@charset
'
))
{
css
=
await
hoistAtRules
(
css
)
}
if
(
minify
&&
config
.
build
.
minify
)
{
css
=
await
minifyCSS
(
css
,
config
)
}
...
...
@@ -712,36 +718,54 @@ async function doUrlReplace(
}
export
async
function
minifyCSS
(
css
:
string
,
config
:
ResolvedConfig
)
{
const
{
code
,
warnings
}
=
await
transform
(
css
,
{
loader
:
'
css
'
,
minify
:
true
,
target
:
config
.
build
.
cssTarget
||
undefined
,
})
if
(
warnings
.
length
)
{
const
msgs
=
await
formatMessages
(
warnings
,
{
kind
:
'
warning
'
})
config
.
logger
.
warn
(
colors
.
yellow
(
`warnings when minifying css:\n
${
msgs
.
join
(
'
\n
'
)}
`
)
)
try
{
const
{
code
,
warnings
}
=
await
transform
(
css
,
{
loader
:
'
css
'
,
minify
:
true
,
target
:
config
.
build
.
cssTarget
||
undefined
,
})
if
(
warnings
.
length
)
{
const
msgs
=
await
formatMessages
(
warnings
,
{
kind
:
'
warning
'
})
config
.
logger
.
warn
(
colors
.
yellow
(
`warnings when minifying css:\n
${
msgs
.
join
(
'
\n
'
)}
`
)
)
}
return
code
}
catch
(
e
:
any
)
{
if
(
e
.
errors
)
{
const
msgs
=
await
formatMessages
(
e
.
errors
,
{
kind
:
'
error
'
})
e
.
frame
=
'
\n
'
+
msgs
.
join
(
'
\n
'
)
e
.
loc
=
e
.
errors
[
0
].
location
}
throw
e
}
return
code
}
const
AtImportHoistPlugin
:
Postcss
.
PluginCreator
<
any
>
=
()
=>
{
return
{
postcssPlugin
:
'
vite-hoist-at-imports
'
,
Once
(
root
)
{
const
imports
:
Postcss
.
AtRule
[]
=
[]
root
.
walkAtRules
((
rule
)
=>
{
if
(
rule
.
name
===
'
import
'
)
{
// record in reverse so that can simply prepend to preserve order
imports
.
unshift
(
rule
)
}
})
imports
.
forEach
((
i
)
=>
root
.
prepend
(
i
))
},
}
export
async
function
hoistAtRules
(
css
:
string
)
{
const
s
=
new
MagicString
(
css
)
// #1845
// CSS @import can only appear at top of the file. We need to hoist all @import
// to top when multiple files are concatenated.
// match until semicolon that's not in quotes
s
.
replace
(
/@import
\s
*
(?:
url
\([^\)]
*
\)
|"
[^
"
]
*"|'
[^
'
]
*'|
[^
;
]
*
)
.*
?
;/gm
,
(
match
)
=>
{
s
.
appendLeft
(
0
,
match
)
return
''
}
)
// #6333
// CSS @charset must be the top-first in the file, hoist the first to top
let
foundCharset
=
false
s
.
replace
(
/@charset
\s
*
(?:
"
[^
"
]
*"|'
[^
'
]
*'|
[^
;
]
*
)
.*
?
;/gm
,
(
match
)
=>
{
if
(
!
foundCharset
)
{
s
.
prepend
(
match
)
foundCharset
=
true
}
return
''
})
return
s
.
toString
()
}
AtImportHoistPlugin
.
postcss
=
true
// Preprocessor support. This logic is largely replicated from @vue/compiler-sfc
...
...
packages/vite-plugin-uni/package.json
浏览文件 @
97144d70
...
...
@@ -53,7 +53,7 @@
"chokidar"
:
"^3.5.3"
},
"peerDependencies"
:
{
"vite"
:
"^2.9.
4
"
"vite"
:
"^2.9.
5
"
},
"uni-app"
:
{
"compilerVersion"
:
"3.4.5"
...
...
pnpm-lock.yaml
浏览文件 @
97144d70
...
...
@@ -47,7 +47,7 @@ importers:
semver
:
^7.3.5
ts-jest
:
^27.0.3
typescript
:
4.6.3
vite
:
^2.9.
4
vite
:
^2.9.
5
vue
:
3.2.33
vue-router
:
^4.0.14
yorkie
:
^2.0.0
...
...
@@ -67,7 +67,7 @@ importers:
'
@rollup/plugin-strip'
:
2.1.0_rollup@2.60.2
'
@types/jest'
:
26.0.24
'
@typescript-eslint/parser'
:
5.14.0_eslint@7.32.0+typescript@4.6.3
'
@vitejs/plugin-vue'
:
2.3.1_vite@2.9.
4
+vue@3.2.33
'
@vitejs/plugin-vue'
:
2.3.1_vite@2.9.
5
+vue@3.2.33
'
@vitejs/plugin-vue-jsx'
:
1.3.10
'
@vue/reactivity'
:
3.2.33
'
@vue/runtime-core'
:
3.2.33
...
...
@@ -95,7 +95,7 @@ importers:
semver
:
7.3.5
ts-jest
:
27.1.0_2528360f5083edd4f29e3d452ccadc0f
typescript
:
4.6.3
vite
:
2.9.
4
vite
:
2.9.
5
vue
:
3.2.33
vue-router
:
4.0.14_vue@3.2.33
yorkie
:
2.0.0
...
...
@@ -109,7 +109,7 @@ importers:
compression
:
^1.7.4
cypress
:
^7.3.0
serve-static
:
^1.14.1
vite
:
^2.9.
4
vite
:
^2.9.
5
vue
:
3.2.33
vue-router
:
^4.0.14
vuex
:
^4.0.2
...
...
@@ -125,7 +125,7 @@ importers:
compression
:
1.7.4
cypress
:
7.7.0
serve-static
:
1.14.1
vite
:
2.9.
4
vite
:
2.9.
5
packages/size-check
:
specifiers
:
...
...
@@ -221,7 +221,7 @@ importers:
'
@dcloudio/uni-nvue-styler'
:
link:../uni-nvue-styler
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@rollup/pluginutils'
:
4.2.0
'
@vitejs/plugin-vue'
:
2.3.1_vite@2.9.
4
+vue@3.2.33
'
@vitejs/plugin-vue'
:
2.3.1_vite@2.9.
5
+vue@3.2.33
'
@vue/compiler-dom'
:
3.2.33
'
@vue/compiler-sfc'
:
3.2.33
debug
:
4.3.3
...
...
@@ -752,8 +752,8 @@ importers:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@rollup/pluginutils'
:
4.2.0
'
@vitejs/plugin-legacy'
:
1.8.1_vite@2.9.
4
'
@vitejs/plugin-vue'
:
2.3.1_vite@2.9.
4
+vue@3.2.33
'
@vitejs/plugin-legacy'
:
1.8.1_vite@2.9.
5
'
@vitejs/plugin-vue'
:
2.3.1_vite@2.9.
5
+vue@3.2.33
'
@vitejs/plugin-vue-jsx'
:
1.3.10
'
@vue/compiler-core'
:
3.2.33
'
@vue/compiler-dom'
:
3.2.33
...
...
@@ -3191,7 +3191,7 @@ packages:
eslint-visitor-keys
:
3.1.0
dev
:
true
/@vitejs/plugin-legacy/1.8.1_vite@2.9.
4
:
/@vitejs/plugin-legacy/1.8.1_vite@2.9.
5
:
resolution
:
{
integrity
:
sha512-kmBWKq7EeNvzS4AqPBqUKdoWG/NYQXh7StUFMWR3D21aN5Mfmar7CTO2a7K+bBxJH/vAL9gnnueA0wb7cycCmQ==
}
engines
:
{
node
:
'
>=12.0.0'
}
peerDependencies
:
...
...
@@ -3202,7 +3202,7 @@ packages:
magic-string
:
0.26.1
regenerator-runtime
:
0.13.9
systemjs
:
6.12.1
vite
:
2.9.
4
vite
:
2.9.
5
dev
:
false
/@vitejs/plugin-vue-jsx/1.3.10
:
...
...
@@ -3218,14 +3218,14 @@ packages:
transitivePeerDependencies
:
-
supports-color
/@vitejs/plugin-vue/2.3.1_vite@2.9.
4
+vue@3.2.33
:
/@vitejs/plugin-vue/2.3.1_vite@2.9.
5
+vue@3.2.33
:
resolution
:
{
integrity
:
sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==
}
engines
:
{
node
:
'
>=12.0.0'
}
peerDependencies
:
vite
:
^2.5.10
vue
:
^3.2.25
dependencies
:
vite
:
2.9.
4
vite
:
2.9.
5
vue
:
3.2.33
/@vue/babel-helper-vue-transform-on/1.0.2
:
...
...
@@ -8680,8 +8680,8 @@ packages:
extsprintf
:
1.3.0
dev
:
true
/vite/2.9.
4
:
resolution
:
{
integrity
:
sha512-
7pO6ruZMsyTpaPB7kGtW+yj15Ze5g+E4w4Ramk1sAJLIuI4uPd5sauqubmZNpq0Yc1vLVxoXRf2Uj+qWxk5aXw
==
}
/vite/2.9.
5
:
resolution
:
{
integrity
:
sha512-
dvMN64X2YEQgSXF1lYabKXw3BbN6e+BL67+P3Vy4MacnY+UzT1AfkHiioFSi9+uiDUiaDy7Ax/LQqivk6orilg
==
}
engines
:
{
node
:
'
>=12.2.0'
}
hasBin
:
true
peerDependencies
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录