Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qianlong66
uni-app
提交
be36ec18
U
uni-app
项目概览
qianlong66
/
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,发现更多精彩内容 >>
提交
be36ec18
编写于
1月 12, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: rename plugins
上级
114fc97f
变更
81
隐藏空白更改
内联
并排
Showing
81 changed file
with
105 addition
and
111 deletion
+105
-111
packages/uni-app-vite/src/nvue/index.ts
packages/uni-app-vite/src/nvue/index.ts
+1
-1
packages/uni-app-vite/src/nvue/plugins/entry.ts
packages/uni-app-vite/src/nvue/plugins/entry.ts
+1
-1
packages/uni-app-vite/src/plugins/confusion.ts
packages/uni-app-vite/src/plugins/confusion.ts
+1
-1
packages/uni-app-vite/src/plugins/easycom.ts
packages/uni-app-vite/src/plugins/easycom.ts
+1
-1
packages/uni-app-vite/src/plugins/mainJs.ts
packages/uni-app-vite/src/plugins/mainJs.ts
+1
-1
packages/uni-app-vite/src/plugins/manifestJson.ts
packages/uni-app-vite/src/plugins/manifestJson.ts
+1
-1
packages/uni-app-vite/src/plugins/pagesJson.ts
packages/uni-app-vite/src/plugins/pagesJson.ts
+1
-1
packages/uni-app-vite/src/plugins/renderjs.ts
packages/uni-app-vite/src/plugins/renderjs.ts
+2
-2
packages/uni-app-vite/src/plugins/resolveId.ts
packages/uni-app-vite/src/plugins/resolveId.ts
+2
-2
packages/uni-app-vite/src/plugins/stats.ts
packages/uni-app-vite/src/plugins/stats.ts
+1
-1
packages/uni-app-vite/src/plugins/template.ts
packages/uni-app-vite/src/plugins/template.ts
+1
-1
packages/uni-automator/lib/uni.plugin.js
packages/uni-automator/lib/uni.plugin.js
+1
-1
packages/uni-automator/src/uni.plugin.ts
packages/uni-automator/src/uni.plugin.ts
+1
-1
packages/uni-cli-nvue/src/plugin.ts
packages/uni-cli-nvue/src/plugin.ts
+1
-1
packages/uni-cli-shared/src/checkUpdate.ts
packages/uni-cli-shared/src/checkUpdate.ts
+1
-1
packages/uni-cli-shared/src/easycom.ts
packages/uni-cli-shared/src/easycom.ts
+1
-1
packages/uni-cli-shared/src/vite/plugins/console.ts
packages/uni-cli-shared/src/vite/plugins/console.ts
+2
-2
packages/uni-cli-shared/src/vite/plugins/copy.ts
packages/uni-cli-shared/src/vite/plugins/copy.ts
+1
-1
packages/uni-cli-shared/src/vite/plugins/cssScoped.ts
packages/uni-cli-shared/src/vite/plugins/cssScoped.ts
+2
-2
packages/uni-cli-shared/src/vite/plugins/inject.ts
packages/uni-cli-shared/src/vite/plugins/inject.ts
+3
-3
packages/uni-cloud/lib/uni.plugin.js
packages/uni-cloud/lib/uni.plugin.js
+1
-1
packages/uni-cloud/lib/validateFunction.js
packages/uni-cloud/lib/validateFunction.js
+1
-1
packages/uni-cloud/src/uni.plugin.ts
packages/uni-cloud/src/uni.plugin.ts
+1
-1
packages/uni-cloud/src/validateFunction.ts
packages/uni-cloud/src/validateFunction.ts
+1
-1
packages/uni-h5-vite/src/plugin/configureServer/static.ts
packages/uni-h5-vite/src/plugin/configureServer/static.ts
+1
-1
packages/uni-h5-vite/src/plugin/esbuild/esbuildPrePlugin.ts
packages/uni-h5-vite/src/plugin/esbuild/esbuildPrePlugin.ts
+1
-1
packages/uni-h5-vite/src/plugin/handleHotUpdate/index.ts
packages/uni-h5-vite/src/plugin/handleHotUpdate/index.ts
+1
-1
packages/uni-h5-vite/src/plugin/index.ts
packages/uni-h5-vite/src/plugin/index.ts
+1
-1
packages/uni-h5-vite/src/plugins/css.ts
packages/uni-h5-vite/src/plugins/css.ts
+1
-1
packages/uni-h5-vite/src/plugins/easycom.ts
packages/uni-h5-vite/src/plugins/easycom.ts
+1
-1
packages/uni-h5-vite/src/plugins/inject.ts
packages/uni-h5-vite/src/plugins/inject.ts
+1
-1
packages/uni-h5-vite/src/plugins/mainJs.ts
packages/uni-h5-vite/src/plugins/mainJs.ts
+1
-1
packages/uni-h5-vite/src/plugins/manifestJson.ts
packages/uni-h5-vite/src/plugins/manifestJson.ts
+1
-1
packages/uni-h5-vite/src/plugins/pagesJson.ts
packages/uni-h5-vite/src/plugins/pagesJson.ts
+1
-1
packages/uni-h5-vite/src/plugins/renderjs.ts
packages/uni-h5-vite/src/plugins/renderjs.ts
+2
-2
packages/uni-h5-vite/src/plugins/resolveId.ts
packages/uni-h5-vite/src/plugins/resolveId.ts
+2
-2
packages/uni-h5-vite/src/plugins/setup.ts
packages/uni-h5-vite/src/plugins/setup.ts
+2
-2
packages/uni-h5-vite/src/plugins/ssr.ts
packages/uni-h5-vite/src/plugins/ssr.ts
+1
-1
packages/uni-mp-alipay/dist/uni.compiler.js
packages/uni-mp-alipay/dist/uni.compiler.js
+1
-1
packages/uni-mp-alipay/src/compiler/index.ts
packages/uni-mp-alipay/src/compiler/index.ts
+1
-1
packages/uni-mp-baidu/dist/uni.compiler.js
packages/uni-mp-baidu/dist/uni.compiler.js
+1
-1
packages/uni-mp-baidu/src/compiler/index.ts
packages/uni-mp-baidu/src/compiler/index.ts
+1
-1
packages/uni-mp-kuaishou/dist/uni.compiler.js
packages/uni-mp-kuaishou/dist/uni.compiler.js
+1
-1
packages/uni-mp-kuaishou/src/compiler/index.ts
packages/uni-mp-kuaishou/src/compiler/index.ts
+1
-1
packages/uni-mp-lark/dist/uni.compiler.js
packages/uni-mp-lark/dist/uni.compiler.js
+1
-1
packages/uni-mp-lark/src/compiler/index.ts
packages/uni-mp-lark/src/compiler/index.ts
+1
-1
packages/uni-mp-qq/dist/uni.compiler.js
packages/uni-mp-qq/dist/uni.compiler.js
+1
-1
packages/uni-mp-qq/src/compiler/index.ts
packages/uni-mp-qq/src/compiler/index.ts
+1
-1
packages/uni-mp-toutiao/dist/uni.compiler.js
packages/uni-mp-toutiao/dist/uni.compiler.js
+1
-1
packages/uni-mp-toutiao/src/compiler/index.ts
packages/uni-mp-toutiao/src/compiler/index.ts
+1
-1
packages/uni-mp-vite/src/plugin/build.ts
packages/uni-mp-vite/src/plugin/build.ts
+1
-1
packages/uni-mp-vite/src/plugin/configResolved.ts
packages/uni-mp-vite/src/plugin/configResolved.ts
+2
-2
packages/uni-mp-vite/src/plugin/index.ts
packages/uni-mp-vite/src/plugin/index.ts
+1
-1
packages/uni-mp-vite/src/plugin/template.ts
packages/uni-mp-vite/src/plugin/template.ts
+1
-1
packages/uni-mp-vite/src/plugins/entry.ts
packages/uni-mp-vite/src/plugins/entry.ts
+1
-1
packages/uni-mp-vite/src/plugins/mainJs.ts
packages/uni-mp-vite/src/plugins/mainJs.ts
+1
-1
packages/uni-mp-vite/src/plugins/manifestJson.ts
packages/uni-mp-vite/src/plugins/manifestJson.ts
+1
-1
packages/uni-mp-vite/src/plugins/pagesJson.ts
packages/uni-mp-vite/src/plugins/pagesJson.ts
+2
-2
packages/uni-mp-vite/src/plugins/plugin.ts
packages/uni-mp-vite/src/plugins/plugin.ts
+1
-1
packages/uni-mp-vite/src/plugins/renderjs.ts
packages/uni-mp-vite/src/plugins/renderjs.ts
+2
-2
packages/uni-mp-vite/src/plugins/runtimeHooks.ts
packages/uni-mp-vite/src/plugins/runtimeHooks.ts
+1
-1
packages/uni-mp-vite/src/plugins/subpackage.ts
packages/uni-mp-vite/src/plugins/subpackage.ts
+1
-1
packages/uni-mp-vite/src/plugins/usingComponents.ts
packages/uni-mp-vite/src/plugins/usingComponents.ts
+1
-1
packages/uni-mp-weixin/dist/uni.compiler.js
packages/uni-mp-weixin/dist/uni.compiler.js
+1
-1
packages/uni-mp-weixin/src/compiler/index.ts
packages/uni-mp-weixin/src/compiler/index.ts
+1
-1
packages/uni-quickapp-webview/dist/uni.compiler.js
packages/uni-quickapp-webview/dist/uni.compiler.js
+1
-1
packages/uni-quickapp-webview/src/compiler/index.ts
packages/uni-quickapp-webview/src/compiler/index.ts
+1
-1
packages/uni-stat/lib/uni.plugin.js
packages/uni-stat/lib/uni.plugin.js
+2
-2
packages/uni-stat/src/plugin/index.ts
packages/uni-stat/src/plugin/index.ts
+2
-2
packages/vite-plugin-uni/bin/uni.js
packages/vite-plugin-uni/bin/uni.js
+1
-7
packages/vite-plugin-uni/src/configResolved/plugins/index.ts
packages/vite-plugin-uni/src/configResolved/plugins/index.ts
+1
-1
packages/vite-plugin-uni/src/configResolved/plugins/json.ts
packages/vite-plugin-uni/src/configResolved/plugins/json.ts
+1
-1
packages/vite-plugin-uni/src/configResolved/plugins/pre.ts
packages/vite-plugin-uni/src/configResolved/plugins/pre.ts
+4
-4
packages/vite-plugin-uni/src/configResolved/plugins/preCss.ts
...ages/vite-plugin-uni/src/configResolved/plugins/preCss.ts
+3
-3
packages/vite-plugin-uni/src/configResolved/plugins/preVue.ts
...ages/vite-plugin-uni/src/configResolved/plugins/preVue.ts
+2
-2
packages/vite-plugin-uni/src/configResolved/plugins/resolveId.ts
...s/vite-plugin-uni/src/configResolved/plugins/resolveId.ts
+2
-2
packages/vite-plugin-uni/src/configResolved/plugins/ssr.ts
packages/vite-plugin-uni/src/configResolved/plugins/ssr.ts
+2
-2
packages/vite-plugin-uni/src/configResolved/plugins/static.ts
...ages/vite-plugin-uni/src/configResolved/plugins/static.ts
+2
-2
packages/vite-plugin-uni/src/index.ts
packages/vite-plugin-uni/src/index.ts
+2
-2
packages/vite-plugin-uni/src/plugins/copy.ts
packages/vite-plugin-uni/src/plugins/copy.ts
+1
-1
packages/vite-plugin-uni/src/utils/easycom.ts
packages/vite-plugin-uni/src/utils/easycom.ts
+1
-1
未找到文件。
packages/uni-app-vite/src/nvue/index.ts
浏览文件 @
be36ec18
...
@@ -2,7 +2,7 @@ import { Plugin } from 'vite'
...
@@ -2,7 +2,7 @@ import { Plugin } from 'vite'
import
{
createRollupOptions
}
from
'
./rollup
'
import
{
createRollupOptions
}
from
'
./rollup
'
export
function
uniNVuePlugin
(
pagePath
:
string
):
Plugin
{
export
function
uniNVuePlugin
(
pagePath
:
string
):
Plugin
{
return
{
return
{
name
:
'
vite:uni-
app-nvue
'
,
name
:
'
uni:
app-nvue
'
,
config
()
{
config
()
{
return
{
return
{
build
:
{
build
:
{
...
...
packages/uni-app-vite/src/nvue/plugins/entry.ts
浏览文件 @
be36ec18
...
@@ -24,7 +24,7 @@ function parseUniNvuePagePath(uniNVuePageUrl: string) {
...
@@ -24,7 +24,7 @@ function parseUniNvuePagePath(uniNVuePageUrl: string) {
export
function
uniNVueEntryPlugin
():
Plugin
{
export
function
uniNVueEntryPlugin
():
Plugin
{
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
return
{
return
{
name
:
'
vite:uni-
app-nvue-entry
'
,
name
:
'
uni:
app-nvue-entry
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
resolveId
(
id
)
{
resolveId
(
id
)
{
if
(
isUniNVuePageUrl
(
id
))
{
if
(
isUniNVuePageUrl
(
id
))
{
...
...
packages/uni-app-vite/src/plugins/confusion.ts
浏览文件 @
be36ec18
...
@@ -14,7 +14,7 @@ export function uniConfusionPlugin(): Plugin {
...
@@ -14,7 +14,7 @@ export function uniConfusionPlugin(): Plugin {
const
hasConfusion
=
const
hasConfusion
=
process
.
env
.
NODE_ENV
===
'
production
'
&&
hasConfusionFile
(
inputDir
)
process
.
env
.
NODE_ENV
===
'
production
'
&&
hasConfusionFile
(
inputDir
)
return
{
return
{
name
:
'
vite:uni-
app-confusion
'
,
name
:
'
uni:
app-confusion
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
apply
:
'
build
'
,
apply
:
'
build
'
,
config
()
{
config
()
{
...
...
packages/uni-app-vite/src/plugins/easycom.ts
浏览文件 @
be36ec18
...
@@ -18,7 +18,7 @@ interface UniEasycomPluginOptions {
...
@@ -18,7 +18,7 @@ interface UniEasycomPluginOptions {
export
function
uniEasycomPlugin
(
options
:
UniEasycomPluginOptions
):
Plugin
{
export
function
uniEasycomPlugin
(
options
:
UniEasycomPluginOptions
):
Plugin
{
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
return
{
return
{
name
:
'
vite:uni-
app-easycom
'
,
name
:
'
uni:
app-easycom
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
filter
(
id
))
{
if
(
!
filter
(
id
))
{
return
return
...
...
packages/uni-app-vite/src/plugins/mainJs.ts
浏览文件 @
be36ec18
...
@@ -3,7 +3,7 @@ import { defineUniMainJsPlugin } from '@dcloudio/uni-cli-shared'
...
@@ -3,7 +3,7 @@ import { defineUniMainJsPlugin } from '@dcloudio/uni-cli-shared'
export
function
uniMainJsPlugin
()
{
export
function
uniMainJsPlugin
()
{
return
defineUniMainJsPlugin
((
opts
)
=>
{
return
defineUniMainJsPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
app-main-js
'
,
name
:
'
uni:
app-main-js
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
opts
.
filter
(
id
))
{
if
(
opts
.
filter
(
id
))
{
...
...
packages/uni-app-vite/src/plugins/manifestJson.ts
浏览文件 @
be36ec18
...
@@ -13,7 +13,7 @@ export function uniManifestJsonPlugin(): Plugin {
...
@@ -13,7 +13,7 @@ export function uniManifestJsonPlugin(): Plugin {
return
defineUniManifestJsonPlugin
((
opts
)
=>
{
return
defineUniManifestJsonPlugin
((
opts
)
=>
{
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
return
{
return
{
name
:
'
vite:uni-
app-manifest-json
'
,
name
:
'
uni:
app-manifest-json
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
opts
.
filter
(
id
))
{
if
(
!
opts
.
filter
(
id
))
{
...
...
packages/uni-app-vite/src/plugins/pagesJson.ts
浏览文件 @
be36ec18
...
@@ -14,7 +14,7 @@ import { initWebpackNVueEntry } from '@dcloudio/uni-cli-nvue'
...
@@ -14,7 +14,7 @@ import { initWebpackNVueEntry } from '@dcloudio/uni-cli-nvue'
export
function
uniPagesJsonPlugin
():
Plugin
{
export
function
uniPagesJsonPlugin
():
Plugin
{
return
defineUniPagesJsonPlugin
((
opts
)
=>
{
return
defineUniPagesJsonPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
app-pages-json
'
,
name
:
'
uni:
app-pages-json
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
opts
.
filter
(
id
))
{
if
(
!
opts
.
filter
(
id
))
{
...
...
packages/uni-app-vite/src/plugins/renderjs.ts
浏览文件 @
be36ec18
...
@@ -13,7 +13,7 @@ import {
...
@@ -13,7 +13,7 @@ import {
transformWithEsbuild
,
transformWithEsbuild
,
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
const
debugRenderjs
=
debug
(
'
vite:uni:
renderjs
'
)
const
debugRenderjs
=
debug
(
'
uni:app-
renderjs
'
)
export
const
APP_WXS_JS
=
'
app-wxs.js
'
export
const
APP_WXS_JS
=
'
app-wxs.js
'
export
const
APP_RENDERJS_JS
=
'
app-renderjs.js
'
export
const
APP_RENDERJS_JS
=
'
app-renderjs.js
'
...
@@ -24,7 +24,7 @@ export function uniRenderjsPlugin(): Plugin {
...
@@ -24,7 +24,7 @@ export function uniRenderjsPlugin(): Plugin {
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
let
changed
:
boolean
=
false
let
changed
:
boolean
=
false
return
{
return
{
name
:
'
vite:uni-
app-renderjs
'
,
name
:
'
uni:
app-renderjs
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
wxsModulesCache
.
set
(
resolvedConfig
,
new
Map
<
string
,
string
>
())
wxsModulesCache
.
set
(
resolvedConfig
,
new
Map
<
string
,
string
>
())
...
...
packages/uni-app-vite/src/plugins/resolveId.ts
浏览文件 @
be36ec18
...
@@ -3,12 +3,12 @@ import { Plugin } from 'vite'
...
@@ -3,12 +3,12 @@ import { Plugin } from 'vite'
import
{
resolveBuiltIn
}
from
'
@dcloudio/uni-cli-shared
'
import
{
resolveBuiltIn
}
from
'
@dcloudio/uni-cli-shared
'
const
debugResolve
=
debug
(
'
vite:uni:resolve
'
)
const
debugResolve
=
debug
(
'
uni:app-resolve-id
'
)
export
function
uniResolveIdPlugin
():
Plugin
{
export
function
uniResolveIdPlugin
():
Plugin
{
const
resolveCache
:
Record
<
string
,
string
>
=
{}
const
resolveCache
:
Record
<
string
,
string
>
=
{}
return
{
return
{
name
:
'
vite:uni-
app-resolve-id
'
,
name
:
'
uni:
app-resolve-id
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
configResolved
()
{
configResolved
()
{
resolveCache
[
'
@dcloudio/uni-app-vue
'
]
=
resolveBuiltIn
(
resolveCache
[
'
@dcloudio/uni-app-vue
'
]
=
resolveBuiltIn
(
...
...
packages/uni-app-vite/src/plugins/stats.ts
浏览文件 @
be36ec18
...
@@ -6,7 +6,7 @@ const emittedHashMap = new WeakMap<ResolvedConfig, Map<string, string>>()
...
@@ -6,7 +6,7 @@ const emittedHashMap = new WeakMap<ResolvedConfig, Map<string, string>>()
export
function
uniStatsPlugin
():
Plugin
{
export
function
uniStatsPlugin
():
Plugin
{
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
return
{
return
{
name
:
'
vite:uni-
app-stats
'
,
name
:
'
uni:
app-stats
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
...
...
packages/uni-app-vite/src/plugins/template.ts
浏览文件 @
be36ec18
...
@@ -45,7 +45,7 @@ function genViewHtml(bundle: OutputBundle) {
...
@@ -45,7 +45,7 @@ function genViewHtml(bundle: OutputBundle) {
export
function
uniTemplatePlugin
():
Plugin
{
export
function
uniTemplatePlugin
():
Plugin
{
let
outputDir
:
string
let
outputDir
:
string
return
{
return
{
name
:
'
vite:uni-
app-template
'
,
name
:
'
uni:
app-template
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
configResolved
()
{
configResolved
()
{
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
...
...
packages/uni-automator/lib/uni.plugin.js
浏览文件 @
be36ec18
...
@@ -9,7 +9,7 @@ const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
...
@@ -9,7 +9,7 @@ const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
exports
.
default
=
[
exports
.
default
=
[
(
0
,
uni_cli_shared_1
.
defineUniMainJsPlugin
)((
opts
)
=>
{
(
0
,
uni_cli_shared_1
.
defineUniMainJsPlugin
)((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
automator
'
,
name
:
'
uni:
automator
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
configResolved
()
{
configResolved
()
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
...
...
packages/uni-automator/src/uni.plugin.ts
浏览文件 @
be36ec18
...
@@ -5,7 +5,7 @@ import { defineUniMainJsPlugin } from '@dcloudio/uni-cli-shared'
...
@@ -5,7 +5,7 @@ import { defineUniMainJsPlugin } from '@dcloudio/uni-cli-shared'
export
default
[
export
default
[
defineUniMainJsPlugin
((
opts
)
=>
{
defineUniMainJsPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
automator
'
,
name
:
'
uni:
automator
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
configResolved
()
{
configResolved
()
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
...
...
packages/uni-cli-nvue/src/plugin.ts
浏览文件 @
be36ec18
...
@@ -9,7 +9,7 @@ const UniAppNVuePlugin = (): UniVitePlugin => {
...
@@ -9,7 +9,7 @@ const UniAppNVuePlugin = (): UniVitePlugin => {
let
lastNVueEntry
:
string
let
lastNVueEntry
:
string
let
isPagesJsonChanged
:
boolean
=
false
let
isPagesJsonChanged
:
boolean
=
false
return
{
return
{
name
:
'
vite:uni-
cli-nvue
'
,
name
:
'
uni:
cli-nvue
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
config
()
{
config
()
{
if
(
process
.
env
.
UNI_NVUE_COMPILER
===
'
vue
'
)
{
if
(
process
.
env
.
UNI_NVUE_COMPILER
===
'
vue
'
)
{
...
...
packages/uni-cli-shared/src/checkUpdate.ts
浏览文件 @
be36ec18
...
@@ -10,7 +10,7 @@ import { hasOwn, isString, isPlainObject } from '@vue/shared'
...
@@ -10,7 +10,7 @@ import { hasOwn, isString, isPlainObject } from '@vue/shared'
import
{
parseManifestJsonOnce
}
from
'
./json
'
import
{
parseManifestJsonOnce
}
from
'
./json
'
import
{
isInHBuilderX
}
from
'
./hbx
'
import
{
isInHBuilderX
}
from
'
./hbx
'
const
debugCheckUpdate
=
debug
(
'
vite:
uni:check-update
'
)
const
debugCheckUpdate
=
debug
(
'
uni:check-update
'
)
interface
CheckUpdateOptions
{
interface
CheckUpdateOptions
{
inputDir
:
string
inputDir
:
string
...
...
packages/uni-cli-shared/src/easycom.ts
浏览文件 @
be36ec18
...
@@ -24,7 +24,7 @@ interface EasycomCustom {
...
@@ -24,7 +24,7 @@ interface EasycomCustom {
[
key
:
string
]:
string
[
key
:
string
]:
string
}
}
const
debugEasycom
=
debug
(
'
vite:
uni:easycom
'
)
const
debugEasycom
=
debug
(
'
uni:easycom
'
)
const
easycoms
:
EasycomMatcher
[]
=
[]
const
easycoms
:
EasycomMatcher
[]
=
[]
...
...
packages/uni-cli-shared/src/vite/plugins/console.ts
浏览文件 @
be36ec18
...
@@ -12,13 +12,13 @@ export interface ConsoleOptions {
...
@@ -12,13 +12,13 @@ export interface ConsoleOptions {
exclude
?:
FilterPattern
exclude
?:
FilterPattern
}
}
const
debugConsole
=
debug
(
'
vite:
uni:console
'
)
const
debugConsole
=
debug
(
'
uni:console
'
)
export
function
uniConsolePlugin
(
options
:
ConsoleOptions
):
Plugin
{
export
function
uniConsolePlugin
(
options
:
ConsoleOptions
):
Plugin
{
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
return
{
return
{
name
:
'
vite:uni-
console
'
,
name
:
'
uni:
console
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
...
...
packages/uni-cli-shared/src/vite/plugins/copy.ts
浏览文件 @
be36ec18
...
@@ -17,7 +17,7 @@ export function uniViteCopyPlugin({
...
@@ -17,7 +17,7 @@ export function uniViteCopyPlugin({
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
let
inited
=
false
let
inited
=
false
return
{
return
{
name
:
'
vite:uni-
copy
'
,
name
:
'
uni:
copy
'
,
apply
:
'
build
'
,
apply
:
'
build
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
...
...
packages/uni-cli-shared/src/vite/plugins/cssScoped.ts
浏览文件 @
be36ec18
...
@@ -4,7 +4,7 @@ import type { Plugin } from 'vite'
...
@@ -4,7 +4,7 @@ import type { Plugin } from 'vite'
import
{
EXTNAME_VUE
}
from
'
../../constants
'
import
{
EXTNAME_VUE
}
from
'
../../constants
'
import
{
preHtml
,
preJs
}
from
'
../../preprocess
'
import
{
preHtml
,
preJs
}
from
'
../../preprocess
'
const
debugScoped
=
debug
(
'
vite:
uni:scoped
'
)
const
debugScoped
=
debug
(
'
uni:scoped
'
)
const
SCOPED_RE
=
/<style
\s[^
>
]
*scoped
[^
>
]
*>/i
const
SCOPED_RE
=
/<style
\s[^
>
]
*scoped
[^
>
]
*>/i
...
@@ -23,7 +23,7 @@ export function uniCssScopedPlugin(
...
@@ -23,7 +23,7 @@ export function uniCssScopedPlugin(
{
filter
}:
UniCssScopedPluginOptions
=
{
filter
:
()
=>
false
}
{
filter
}:
UniCssScopedPluginOptions
=
{
filter
:
()
=>
false
}
):
Plugin
{
):
Plugin
{
return
{
return
{
name
:
'
vite:uni-
css-scoped
'
,
name
:
'
uni:
css-scoped
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
filter
(
id
))
return
null
if
(
!
filter
(
id
))
return
null
...
...
packages/uni-cli-shared/src/vite/plugins/inject.ts
浏览文件 @
be36ec18
...
@@ -39,8 +39,8 @@ export interface InjectOptions {
...
@@ -39,8 +39,8 @@ export interface InjectOptions {
[
str
:
string
]:
Injectment
|
FilterPattern
|
Boolean
|
Function
|
undefined
[
str
:
string
]:
Injectment
|
FilterPattern
|
Boolean
|
Function
|
undefined
}
}
const
debugInject
=
debug
(
'
vite:
uni:inject
'
)
const
debugInject
=
debug
(
'
uni:inject
'
)
const
debugInjectTry
=
debug
(
'
vite:
uni:inject-try
'
)
const
debugInjectTry
=
debug
(
'
uni:inject-try
'
)
export
function
uniViteInjectPlugin
(
options
:
InjectOptions
):
Plugin
{
export
function
uniViteInjectPlugin
(
options
:
InjectOptions
):
Plugin
{
if
(
!
options
)
throw
new
Error
(
'
Missing options
'
)
if
(
!
options
)
throw
new
Error
(
'
Missing options
'
)
...
@@ -76,7 +76,7 @@ export function uniViteInjectPlugin(options: InjectOptions): Plugin {
...
@@ -76,7 +76,7 @@ export function uniViteInjectPlugin(options: InjectOptions): Plugin {
const
sourceMap
=
options
.
sourceMap
!==
false
const
sourceMap
=
options
.
sourceMap
!==
false
const
callback
=
options
.
callback
const
callback
=
options
.
callback
return
{
return
{
name
:
'
vite:uni-
inject
'
,
name
:
'
uni:
inject
'
,
// 确保在 commonjs 之后,否则会混合 es6 module 与 cjs 的代码,导致 commonjs 失效
// 确保在 commonjs 之后,否则会混合 es6 module 与 cjs 的代码,导致 commonjs 失效
enforce
:
'
post
'
,
enforce
:
'
post
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
...
...
packages/uni-cloud/lib/uni.plugin.js
浏览文件 @
be36ec18
...
@@ -10,7 +10,7 @@ initUniCloudEnv();
...
@@ -10,7 +10,7 @@ initUniCloudEnv();
* @type {import('vite').Plugin}
* @type {import('vite').Plugin}
*/
*/
const
UniCloudPlugin
=
{
const
UniCloudPlugin
=
{
name
:
'
vite:uni-
cloud
'
,
name
:
'
uni:
cloud
'
,
config
(
config
)
{
config
(
config
)
{
const
silent
=
config
.
build
&&
config
.
build
.
ssr
?
true
:
false
;
const
silent
=
config
.
build
&&
config
.
build
.
ssr
?
true
:
false
;
if
(
silent
)
{
if
(
silent
)
{
...
...
packages/uni-cloud/lib/validateFunction.js
浏览文件 @
be36ec18
...
@@ -6,7 +6,7 @@ function replaceModuleExports(code) {
...
@@ -6,7 +6,7 @@ function replaceModuleExports(code) {
}
}
function
uniValidateFunctionPlugin
()
{
function
uniValidateFunctionPlugin
()
{
return
{
return
{
name
:
'
vite:uni-
cloud-vf
'
,
name
:
'
uni:
cloud-vf
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
id
.
includes
(
'
validator/validateFunction
'
))
{
if
(
id
.
includes
(
'
validator/validateFunction
'
))
{
...
...
packages/uni-cloud/src/uni.plugin.ts
浏览文件 @
be36ec18
...
@@ -23,7 +23,7 @@ initUniCloudEnv()
...
@@ -23,7 +23,7 @@ initUniCloudEnv()
* @type {import('vite').Plugin}
* @type {import('vite').Plugin}
*/
*/
const
UniCloudPlugin
:
UniVitePlugin
=
{
const
UniCloudPlugin
:
UniVitePlugin
=
{
name
:
'
vite:uni-
cloud
'
,
name
:
'
uni:
cloud
'
,
config
(
config
)
{
config
(
config
)
{
const
silent
=
config
.
build
&&
config
.
build
.
ssr
?
true
:
false
const
silent
=
config
.
build
&&
config
.
build
.
ssr
?
true
:
false
if
(
silent
)
{
if
(
silent
)
{
...
...
packages/uni-cloud/src/validateFunction.ts
浏览文件 @
be36ec18
...
@@ -4,7 +4,7 @@ function replaceModuleExports(code: string) {
...
@@ -4,7 +4,7 @@ function replaceModuleExports(code: string) {
}
}
export
function
uniValidateFunctionPlugin
():
Plugin
{
export
function
uniValidateFunctionPlugin
():
Plugin
{
return
{
return
{
name
:
'
vite:uni-
cloud-vf
'
,
name
:
'
uni:
cloud-vf
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
id
.
includes
(
'
validator/validateFunction
'
))
{
if
(
id
.
includes
(
'
validator/validateFunction
'
))
{
...
...
packages/uni-h5-vite/src/plugin/configureServer/static.ts
浏览文件 @
be36ec18
...
@@ -11,7 +11,7 @@ import {
...
@@ -11,7 +11,7 @@ import {
import
{
uniStaticMiddleware
}
from
'
./middlewares/static
'
import
{
uniStaticMiddleware
}
from
'
./middlewares/static
'
const
debugStatic
=
debug
(
'
vite:
uni:static
'
)
const
debugStatic
=
debug
(
'
uni:static
'
)
/**
/**
* devServer时提供static等目录的静态资源服务
* devServer时提供static等目录的静态资源服务
* @param server
* @param server
...
...
packages/uni-h5-vite/src/plugin/esbuild/esbuildPrePlugin.ts
浏览文件 @
be36ec18
...
@@ -7,7 +7,7 @@ export const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/
...
@@ -7,7 +7,7 @@ export const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/
export
function
esbuildPrePlugin
():
Plugin
{
export
function
esbuildPrePlugin
():
Plugin
{
return
{
return
{
name
:
'
vite
:dep-scan
'
,
name
:
'
uni
:dep-scan
'
,
setup
(
build
)
{
setup
(
build
)
{
build
.
onLoad
({
filter
:
JS_TYPES_RE
},
({
path
:
id
})
=>
{
build
.
onLoad
({
filter
:
JS_TYPES_RE
},
({
path
:
id
})
=>
{
let
ext
=
path
.
extname
(
id
).
slice
(
1
)
let
ext
=
path
.
extname
(
id
).
slice
(
1
)
...
...
packages/uni-h5-vite/src/plugin/handleHotUpdate/index.ts
浏览文件 @
be36ec18
...
@@ -11,7 +11,7 @@ import {
...
@@ -11,7 +11,7 @@ import {
resolveComponentsLibPath
,
resolveComponentsLibPath
,
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
const
debugHmr
=
debug
(
'
vite:
uni:hmr
'
)
const
debugHmr
=
debug
(
'
uni:hmr
'
)
async
function
invalidate
(
file
:
string
,
moduleGraph
:
ModuleGraph
)
{
async
function
invalidate
(
file
:
string
,
moduleGraph
:
ModuleGraph
)
{
const
mods
=
await
moduleGraph
.
getModulesByFile
(
normalizePath
(
file
))
const
mods
=
await
moduleGraph
.
getModulesByFile
(
normalizePath
(
file
))
...
...
packages/uni-h5-vite/src/plugin/index.ts
浏览文件 @
be36ec18
...
@@ -18,7 +18,7 @@ export function uniH5Plugin(): UniVitePlugin {
...
@@ -18,7 +18,7 @@ export function uniH5Plugin(): UniVitePlugin {
}
}
rewriteReadFileSync
()
rewriteReadFileSync
()
return
{
return
{
name
:
'
vite:uni-
h5
'
,
name
:
'
uni:
h5
'
,
uni
:
createUni
(),
uni
:
createUni
(),
config
:
createConfig
(
configOptions
),
config
:
createConfig
(
configOptions
),
configResolved
(
config
)
{
configResolved
(
config
)
{
...
...
packages/uni-h5-vite/src/plugins/css.ts
浏览文件 @
be36ec18
...
@@ -21,7 +21,7 @@ export function uniCssPlugin(): Plugin {
...
@@ -21,7 +21,7 @@ export function uniCssPlugin(): Plugin {
let
file
=
''
let
file
=
''
let
fileName
=
''
let
fileName
=
''
return
{
return
{
name
:
'
vite:uni-
h5-css
'
,
name
:
'
uni:
h5-css
'
,
apply
:
'
build
'
,
apply
:
'
build
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
...
...
packages/uni-h5-vite/src/plugins/easycom.ts
浏览文件 @
be36ec18
...
@@ -60,7 +60,7 @@ export function uniEasycomPlugin(options: UniEasycomPluginOptions): Plugin {
...
@@ -60,7 +60,7 @@ export function uniEasycomPlugin(options: UniEasycomPluginOptions): Plugin {
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
let
needCombineBuiltInCss
=
false
let
needCombineBuiltInCss
=
false
return
{
return
{
name
:
'
vite:uni-
h5-easycom
'
,
name
:
'
uni:
h5-easycom
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
needCombineBuiltInCss
=
isCombineBuiltInCss
(
config
)
needCombineBuiltInCss
=
isCombineBuiltInCss
(
config
)
},
},
...
...
packages/uni-h5-vite/src/plugins/inject.ts
浏览文件 @
be36ec18
...
@@ -54,7 +54,7 @@ export function uniInjectPlugin(): Plugin {
...
@@ -54,7 +54,7 @@ export function uniInjectPlugin(): Plugin {
let
injectPlugin
:
Plugin
let
injectPlugin
:
Plugin
return
{
return
{
name
:
'
vite:uni-
h5-inject
'
,
name
:
'
uni:
h5-inject
'
,
apply
:
'
build
'
,
apply
:
'
build
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
...
...
packages/uni-h5-vite/src/plugins/mainJs.ts
浏览文件 @
be36ec18
...
@@ -7,7 +7,7 @@ export function uniMainJsPlugin() {
...
@@ -7,7 +7,7 @@ export function uniMainJsPlugin() {
let
pagesJsonJsPath
=
''
let
pagesJsonJsPath
=
''
let
runSSR
=
false
let
runSSR
=
false
return
{
return
{
name
:
'
vite:uni-
h5-main-js
'
,
name
:
'
uni:
h5-main-js
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
pagesJsonJsPath
=
normalizePath
(
pagesJsonJsPath
=
normalizePath
(
...
...
packages/uni-h5-vite/src/plugins/manifestJson.ts
浏览文件 @
be36ec18
...
@@ -23,7 +23,7 @@ const defaultAsync = {
...
@@ -23,7 +23,7 @@ const defaultAsync = {
export
function
uniManifestJsonPlugin
():
Plugin
{
export
function
uniManifestJsonPlugin
():
Plugin
{
return
defineUniManifestJsonPlugin
((
opts
)
=>
{
return
defineUniManifestJsonPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
h5-manifest-json
'
,
name
:
'
uni:
h5-manifest-json
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
opts
.
filter
(
id
))
{
if
(
!
opts
.
filter
(
id
))
{
...
...
packages/uni-h5-vite/src/plugins/pagesJson.ts
浏览文件 @
be36ec18
...
@@ -19,7 +19,7 @@ import { isSSR } from '../utils'
...
@@ -19,7 +19,7 @@ import { isSSR } from '../utils'
export
function
uniPagesJsonPlugin
():
Plugin
{
export
function
uniPagesJsonPlugin
():
Plugin
{
return
defineUniPagesJsonPlugin
((
opts
)
=>
{
return
defineUniPagesJsonPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
h5-pages-json
'
,
name
:
'
uni:
h5-pages-json
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
,
opt
)
{
transform
(
code
,
id
,
opt
)
{
if
(
opts
.
filter
(
id
))
{
if
(
opts
.
filter
(
id
))
{
...
...
packages/uni-h5-vite/src/plugins/renderjs.ts
浏览文件 @
be36ec18
...
@@ -4,11 +4,11 @@ import { rewriteDefault } from '@vue/compiler-sfc'
...
@@ -4,11 +4,11 @@ import { rewriteDefault } from '@vue/compiler-sfc'
import
{
missingModuleName
,
parseRenderjs
}
from
'
@dcloudio/uni-cli-shared
'
import
{
missingModuleName
,
parseRenderjs
}
from
'
@dcloudio/uni-cli-shared
'
const
debugRenderjs
=
debug
(
'
vite:uni:
renderjs
'
)
const
debugRenderjs
=
debug
(
'
uni:h5-
renderjs
'
)
export
function
uniRenderjsPlugin
():
Plugin
{
export
function
uniRenderjsPlugin
():
Plugin
{
return
{
return
{
name
:
'
vite:uni-
h5-renderjs
'
,
name
:
'
uni:
h5-renderjs
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
const
{
type
,
name
}
=
parseRenderjs
(
id
)
const
{
type
,
name
}
=
parseRenderjs
(
id
)
if
(
!
type
)
{
if
(
!
type
)
{
...
...
packages/uni-h5-vite/src/plugins/resolveId.ts
浏览文件 @
be36ec18
...
@@ -5,12 +5,12 @@ import type { Plugin } from 'vite'
...
@@ -5,12 +5,12 @@ import type { Plugin } from 'vite'
import
{
resolveBuiltIn
}
from
'
@dcloudio/uni-cli-shared
'
import
{
resolveBuiltIn
}
from
'
@dcloudio/uni-cli-shared
'
import
{
ownerModuleName
}
from
'
../utils
'
import
{
ownerModuleName
}
from
'
../utils
'
const
debugResolve
=
debug
(
'
vite:
uni:resolve
'
)
const
debugResolve
=
debug
(
'
uni:resolve
'
)
export
function
uniResolveIdPlugin
():
Plugin
{
export
function
uniResolveIdPlugin
():
Plugin
{
const
resolveCache
:
Record
<
string
,
string
>
=
{}
const
resolveCache
:
Record
<
string
,
string
>
=
{}
return
{
return
{
name
:
'
vite:uni-
h5-resolve-id
'
,
name
:
'
uni:
h5-resolve-id
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
config
()
{
config
()
{
resolveCache
[
ownerModuleName
]
=
resolveBuiltIn
(
resolveCache
[
ownerModuleName
]
=
resolveBuiltIn
(
...
...
packages/uni-h5-vite/src/plugins/setup.ts
浏览文件 @
be36ec18
...
@@ -7,13 +7,13 @@ import {
...
@@ -7,13 +7,13 @@ import {
withSourcemap
,
withSourcemap
,
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
const
debugSetup
=
debug
(
'
vite:
uni:setup
'
)
const
debugSetup
=
debug
(
'
uni:setup
'
)
export
function
uniSetupPlugin
():
Plugin
{
export
function
uniSetupPlugin
():
Plugin
{
let
appVuePath
:
string
let
appVuePath
:
string
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
return
{
return
{
name
:
'
vite:uni-
setup
'
,
name
:
'
uni:
setup
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
appVuePath
=
normalizePath
(
appVuePath
=
normalizePath
(
...
...
packages/uni-h5-vite/src/plugins/ssr.ts
浏览文件 @
be36ec18
...
@@ -23,7 +23,7 @@ export function uniSSRPlugin(): Plugin {
...
@@ -23,7 +23,7 @@ export function uniSSRPlugin(): Plugin {
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
const
entryServerJsCode
=
generateSsrEntryServerCode
()
const
entryServerJsCode
=
generateSsrEntryServerCode
()
return
{
return
{
name
:
'
vite:uni-
h5-ssr
'
,
name
:
'
uni:
h5-ssr
'
,
config
(
userConfig
,
env
)
{
config
(
userConfig
,
env
)
{
if
(
isSsr
(
env
.
command
,
userConfig
))
{
if
(
isSsr
(
env
.
command
,
userConfig
))
{
rewriteSsrVue
()
rewriteSsrVue
()
...
...
packages/uni-mp-alipay/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -234,7 +234,7 @@ const options = {
...
@@ -234,7 +234,7 @@ const options = {
};
};
const
uniMiniProgramAlipayPlugin
=
{
const
uniMiniProgramAlipayPlugin
=
{
name
:
'
vite:uni-
mp-alipay
'
,
name
:
'
uni:
mp-alipay
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-alipay/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
import
{
options
}
from
'
./options
'
import
{
options
}
from
'
./options
'
const
uniMiniProgramAlipayPlugin
:
Plugin
=
{
const
uniMiniProgramAlipayPlugin
:
Plugin
=
{
name
:
'
vite:uni-
mp-alipay
'
,
name
:
'
uni:
mp-alipay
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-baidu/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -130,7 +130,7 @@ const options = {
...
@@ -130,7 +130,7 @@ const options = {
};
};
const
uniMiniProgramBaiduPlugin
=
{
const
uniMiniProgramBaiduPlugin
=
{
name
:
'
vite:uni-
mp-baidu
'
,
name
:
'
uni:
mp-baidu
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-baidu/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -2,7 +2,7 @@ import type { Plugin } from 'vite'
...
@@ -2,7 +2,7 @@ import type { Plugin } from 'vite'
import
initMiniProgramPlugin
from
'
@dcloudio/uni-mp-vite
'
import
initMiniProgramPlugin
from
'
@dcloudio/uni-mp-vite
'
import
{
options
}
from
'
./options
'
import
{
options
}
from
'
./options
'
const
uniMiniProgramBaiduPlugin
:
Plugin
=
{
const
uniMiniProgramBaiduPlugin
:
Plugin
=
{
name
:
'
vite:uni-
mp-baidu
'
,
name
:
'
uni:
mp-baidu
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-kuaishou/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -184,7 +184,7 @@ const options = {
...
@@ -184,7 +184,7 @@ const options = {
};
};
const
uniMiniProgramKuaishouPlugin
=
{
const
uniMiniProgramKuaishouPlugin
=
{
name
:
'
vite:uni-
mp-kuaishou
'
,
name
:
'
uni:
mp-kuaishou
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-kuaishou/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
import
{
options
}
from
'
./options
'
import
{
options
}
from
'
./options
'
const
uniMiniProgramKuaishouPlugin
:
Plugin
=
{
const
uniMiniProgramKuaishouPlugin
:
Plugin
=
{
name
:
'
vite:uni-
mp-kuaishou
'
,
name
:
'
uni:
mp-kuaishou
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-lark/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -127,7 +127,7 @@ ${filter.code}
...
@@ -127,7 +127,7 @@ ${filter.code}
};
};
const
uniMiniProgramToutiaoPlugin
=
{
const
uniMiniProgramToutiaoPlugin
=
{
name
:
'
vite:uni-
mp-lark
'
,
name
:
'
uni:
mp-lark
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-lark/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -5,7 +5,7 @@ import { ASSETS_INLINE_LIMIT } from '@dcloudio/uni-cli-shared'
...
@@ -5,7 +5,7 @@ import { ASSETS_INLINE_LIMIT } from '@dcloudio/uni-cli-shared'
import
{
options
}
from
'
@dcloudio/uni-mp-toutiao/src/compiler/options
'
import
{
options
}
from
'
@dcloudio/uni-mp-toutiao/src/compiler/options
'
const
uniMiniProgramToutiaoPlugin
:
Plugin
=
{
const
uniMiniProgramToutiaoPlugin
:
Plugin
=
{
name
:
'
vite:uni-
mp-lark
'
,
name
:
'
uni:
mp-lark
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-qq/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -157,7 +157,7 @@ const options = {
...
@@ -157,7 +157,7 @@ const options = {
};
};
const
uniMiniProgramQQPlugin
=
{
const
uniMiniProgramQQPlugin
=
{
name
:
'
vite:uni-
mp-qq
'
,
name
:
'
uni:
mp-qq
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-qq/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -6,7 +6,7 @@ import { fix2648 } from './fix2648'
...
@@ -6,7 +6,7 @@ import { fix2648 } from './fix2648'
import
{
options
}
from
'
./options
'
import
{
options
}
from
'
./options
'
const
uniMiniProgramQQPlugin
:
Plugin
=
{
const
uniMiniProgramQQPlugin
:
Plugin
=
{
name
:
'
vite:uni-
mp-qq
'
,
name
:
'
uni:
mp-qq
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-toutiao/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -127,7 +127,7 @@ ${filter.code}
...
@@ -127,7 +127,7 @@ ${filter.code}
};
};
const
uniMiniProgramToutiaoPlugin
=
{
const
uniMiniProgramToutiaoPlugin
=
{
name
:
'
vite:uni-
mp-toutiao
'
,
name
:
'
uni:
mp-toutiao
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-toutiao/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -5,7 +5,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
...
@@ -5,7 +5,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
import
{
options
}
from
'
./options
'
import
{
options
}
from
'
./options
'
const
uniMiniProgramToutiaoPlugin
:
Plugin
=
{
const
uniMiniProgramToutiaoPlugin
:
Plugin
=
{
name
:
'
vite:uni-
mp-toutiao
'
,
name
:
'
uni:
mp-toutiao
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-vite/src/plugin/build.ts
浏览文件 @
be36ec18
...
@@ -23,7 +23,7 @@ import {
...
@@ -23,7 +23,7 @@ import {
parseVirtualPagePath
,
parseVirtualPagePath
,
}
from
'
../plugins/entry
'
}
from
'
../plugins/entry
'
const
debugChunk
=
debug
(
'
vite:
uni:chunk
'
)
const
debugChunk
=
debug
(
'
uni:chunk
'
)
export
function
buildOptions
():
UserConfig
[
'
build
'
]
{
export
function
buildOptions
():
UserConfig
[
'
build
'
]
{
const
platform
=
process
.
env
.
UNI_PLATFORM
const
platform
=
process
.
env
.
UNI_PLATFORM
...
...
packages/uni-mp-vite/src/plugin/configResolved.ts
浏览文件 @
be36ec18
...
@@ -21,7 +21,7 @@ import {
...
@@ -21,7 +21,7 @@ import {
parseVirtualPagePath
,
parseVirtualPagePath
,
}
from
'
../plugins/entry
'
}
from
'
../plugins/entry
'
const
debugNVueCss
=
debug
(
'
vite:
uni:nvue-css
'
)
const
debugNVueCss
=
debug
(
'
uni:nvue-css
'
)
const
cssVars
=
`page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}`
const
cssVars
=
`page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}`
const
genShadowCss
=
(
cdn
:
string
)
=>
{
const
genShadowCss
=
(
cdn
:
string
)
=>
{
...
@@ -114,7 +114,7 @@ export function createConfigResolved({
...
@@ -114,7 +114,7 @@ export function createConfigResolved({
function
adjustCssExtname
(
extname
:
string
):
Plugin
{
function
adjustCssExtname
(
extname
:
string
):
Plugin
{
return
{
return
{
name
:
'
vite:uni-
adjust-css-extname
'
,
name
:
'
uni:
adjust-css-extname
'
,
generateBundle
(
_
,
bundle
)
{
generateBundle
(
_
,
bundle
)
{
const
files
=
Object
.
keys
(
bundle
)
const
files
=
Object
.
keys
(
bundle
)
files
.
forEach
((
name
)
=>
{
files
.
forEach
((
name
)
=>
{
...
...
packages/uni-mp-vite/src/plugin/index.ts
浏览文件 @
be36ec18
...
@@ -98,7 +98,7 @@ export function uniMiniProgramPlugin(
...
@@ -98,7 +98,7 @@ export function uniMiniProgramPlugin(
rewriteCompileScript
()
rewriteCompileScript
()
return
{
return
{
name
:
'
vite:uni-
mp
'
,
name
:
'
uni:
mp
'
,
uni
:
uniOptions
({
uni
:
uniOptions
({
copyOptions
,
copyOptions
,
customElements
:
template
.
customElements
,
customElements
:
template
.
customElements
,
...
...
packages/uni-mp-vite/src/plugin/template.ts
浏览文件 @
be36ec18
...
@@ -14,7 +14,7 @@ import {
...
@@ -14,7 +14,7 @@ import {
import
{
getFiltersCache
}
from
'
../plugins/renderjs
'
import
{
getFiltersCache
}
from
'
../plugins/renderjs
'
import
{
UniMiniProgramPluginOptions
}
from
'
.
'
import
{
UniMiniProgramPluginOptions
}
from
'
.
'
const
debugTemplate
=
debug
(
'
vite:
uni:mp-template
'
)
const
debugTemplate
=
debug
(
'
uni:mp-template
'
)
export
function
getFilterFiles
(
export
function
getFilterFiles
(
resolvedConfig
:
ResolvedConfig
,
resolvedConfig
:
ResolvedConfig
,
...
...
packages/uni-mp-vite/src/plugins/entry.ts
浏览文件 @
be36ec18
...
@@ -42,7 +42,7 @@ export function uniEntryPlugin({
...
@@ -42,7 +42,7 @@ export function uniEntryPlugin({
}:
UniMiniProgramPluginOptions
):
Plugin
{
}:
UniMiniProgramPluginOptions
):
Plugin
{
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
return
{
return
{
name
:
'
vite:uni-
virtual
'
,
name
:
'
uni:
virtual
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
resolveId
(
id
)
{
resolveId
(
id
)
{
if
(
isUniPageUrl
(
id
)
||
isUniComponentUrl
(
id
))
{
if
(
isUniPageUrl
(
id
)
||
isUniComponentUrl
(
id
))
{
...
...
packages/uni-mp-vite/src/plugins/mainJs.ts
浏览文件 @
be36ec18
...
@@ -13,7 +13,7 @@ export function uniMainJsPlugin(
...
@@ -13,7 +13,7 @@ export function uniMainJsPlugin(
)
{
)
{
return
defineUniMainJsPlugin
((
opts
)
=>
{
return
defineUniMainJsPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
mp-main-js
'
,
name
:
'
uni:
mp-main-js
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
async
transform
(
source
,
id
)
{
async
transform
(
source
,
id
)
{
if
(
opts
.
filter
(
id
))
{
if
(
opts
.
filter
(
id
))
{
...
...
packages/uni-mp-vite/src/plugins/manifestJson.ts
浏览文件 @
be36ec18
...
@@ -15,7 +15,7 @@ export function uniManifestJsonPlugin(
...
@@ -15,7 +15,7 @@ export function uniManifestJsonPlugin(
let
projectJson
:
Record
<
string
,
any
>
let
projectJson
:
Record
<
string
,
any
>
return
defineUniManifestJsonPlugin
((
opts
)
=>
{
return
defineUniManifestJsonPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
mp-manifest-json
'
,
name
:
'
uni:
mp-manifest-json
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
opts
.
filter
(
id
))
{
if
(
!
opts
.
filter
(
id
))
{
...
...
packages/uni-mp-vite/src/plugins/pagesJson.ts
浏览文件 @
be36ec18
...
@@ -17,7 +17,7 @@ import {
...
@@ -17,7 +17,7 @@ import {
import
{
virtualPagePath
}
from
'
./entry
'
import
{
virtualPagePath
}
from
'
./entry
'
import
{
UniMiniProgramPluginOptions
}
from
'
../plugin
'
import
{
UniMiniProgramPluginOptions
}
from
'
../plugin
'
const
debugPagesJson
=
debug
(
'
vite:
uni:pages-json
'
)
const
debugPagesJson
=
debug
(
'
uni:pages-json
'
)
const
nvueCssPathsCache
=
new
Map
<
ResolvedConfig
,
string
[]
>
()
const
nvueCssPathsCache
=
new
Map
<
ResolvedConfig
,
string
[]
>
()
export
function
getNVueCssPaths
(
config
:
ResolvedConfig
)
{
export
function
getNVueCssPaths
(
config
:
ResolvedConfig
)
{
...
@@ -30,7 +30,7 @@ export function uniPagesJsonPlugin(
...
@@ -30,7 +30,7 @@ export function uniPagesJsonPlugin(
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
return
defineUniPagesJsonPlugin
((
opts
)
=>
{
return
defineUniPagesJsonPlugin
((
opts
)
=>
{
return
{
return
{
name
:
'
vite:uni-
mp-pages-json
'
,
name
:
'
uni:
mp-pages-json
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
...
...
packages/uni-mp-vite/src/plugins/plugin.ts
浏览文件 @
be36ec18
...
@@ -27,7 +27,7 @@ export function uniMiniProgramPluginPlugin({
...
@@ -27,7 +27,7 @@ export function uniMiniProgramPluginPlugin({
)
)
}
}
return
{
return
{
name
:
'
vite:uni-
mp-plugin
'
,
name
:
'
uni:
mp-plugin
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
config
()
{
config
()
{
return
{
return
{
...
...
packages/uni-mp-vite/src/plugins/renderjs.ts
浏览文件 @
be36ec18
...
@@ -8,7 +8,7 @@ import {
...
@@ -8,7 +8,7 @@ import {
parseRenderjs
,
parseRenderjs
,
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
const
debugRenderjs
=
debug
(
'
vite:uni:
renderjs
'
)
const
debugRenderjs
=
debug
(
'
uni:mp-
renderjs
'
)
const
filtersCache
=
new
Map
<
ResolvedConfig
,
MiniProgramFilterOptions
[]
>
()
const
filtersCache
=
new
Map
<
ResolvedConfig
,
MiniProgramFilterOptions
[]
>
()
...
@@ -19,7 +19,7 @@ export function getFiltersCache(resolvedConfig: ResolvedConfig) {
...
@@ -19,7 +19,7 @@ export function getFiltersCache(resolvedConfig: ResolvedConfig) {
export
function
uniRenderjsPlugin
({
lang
}:
{
lang
?:
string
}):
Plugin
{
export
function
uniRenderjsPlugin
({
lang
}:
{
lang
?:
string
}):
Plugin
{
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
return
{
return
{
name
:
'
vite:uni-
mp-renderjs
'
,
name
:
'
uni:
mp-renderjs
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
},
},
...
...
packages/uni-mp-vite/src/plugins/runtimeHooks.ts
浏览文件 @
be36ec18
...
@@ -6,7 +6,7 @@ type RuntimeHooks = keyof typeof MINI_PROGRAM_PAGE_RUNTIME_HOOKS
...
@@ -6,7 +6,7 @@ type RuntimeHooks = keyof typeof MINI_PROGRAM_PAGE_RUNTIME_HOOKS
export
function
uniRuntimeHooksPlugin
():
Plugin
{
export
function
uniRuntimeHooksPlugin
():
Plugin
{
return
{
return
{
name
:
'
vite:uni-
mp-runtime-hooks
'
,
name
:
'
uni:
mp-runtime-hooks
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
async
transform
(
source
,
id
)
{
async
transform
(
source
,
id
)
{
if
(
!
isUniPageSfcFile
(
id
))
{
if
(
!
isUniPageSfcFile
(
id
))
{
...
...
packages/uni-mp-vite/src/plugins/subpackage.ts
浏览文件 @
be36ec18
...
@@ -7,7 +7,7 @@ export function uniSubpackagePlugin({
...
@@ -7,7 +7,7 @@ export function uniSubpackagePlugin({
style
:
{
extname
},
style
:
{
extname
},
}:
UniMiniProgramPluginOptions
):
Plugin
{
}:
UniMiniProgramPluginOptions
):
Plugin
{
return
{
return
{
name
:
'
vite:uni-
mp-subpackage
'
,
name
:
'
uni:
mp-subpackage
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
generateBundle
:
createNonAppGenerateBundle
(
extname
),
generateBundle
:
createNonAppGenerateBundle
(
extname
),
}
}
...
...
packages/uni-mp-vite/src/plugins/usingComponents.ts
浏览文件 @
be36ec18
...
@@ -28,7 +28,7 @@ export function uniUsingComponentsPlugin(
...
@@ -28,7 +28,7 @@ export function uniUsingComponentsPlugin(
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
let
resolvedConfig
:
ResolvedConfig
let
resolvedConfig
:
ResolvedConfig
return
{
return
{
name
:
'
vite:uni-
mp-using-component
'
,
name
:
'
uni:
mp-using-component
'
,
enforce
:
'
post
'
,
enforce
:
'
post
'
,
configResolved
(
config
)
{
configResolved
(
config
)
{
resolvedConfig
=
config
resolvedConfig
=
config
...
...
packages/uni-mp-weixin/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -150,7 +150,7 @@ ${filter.code}
...
@@ -150,7 +150,7 @@ ${filter.code}
};
};
const
uniMiniProgramWeixinPlugin
=
{
const
uniMiniProgramWeixinPlugin
=
{
name
:
'
vite:uni-
mp-weixin
'
,
name
:
'
uni:
mp-weixin
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-mp-weixin/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
import
{
options
}
from
'
./options
'
import
{
options
}
from
'
./options
'
const
uniMiniProgramWeixinPlugin
:
Plugin
=
{
const
uniMiniProgramWeixinPlugin
:
Plugin
=
{
name
:
'
vite:uni-
mp-weixin
'
,
name
:
'
uni:
mp-weixin
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-quickapp-webview/dist/uni.compiler.js
浏览文件 @
be36ec18
...
@@ -110,7 +110,7 @@ ${filter.code}
...
@@ -110,7 +110,7 @@ ${filter.code}
};
};
const
uniQuickappWebviewPlugin
=
{
const
uniQuickappWebviewPlugin
=
{
name
:
'
vite:uni-
quickapp-webview
'
,
name
:
'
uni:
quickapp-webview
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-quickapp-webview/src/compiler/index.ts
浏览文件 @
be36ec18
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
...
@@ -4,7 +4,7 @@ import initMiniProgramPlugin from '@dcloudio/uni-mp-vite'
import
{
options
}
from
'
./options
'
import
{
options
}
from
'
./options
'
const
uniQuickappWebviewPlugin
:
Plugin
=
{
const
uniQuickappWebviewPlugin
:
Plugin
=
{
name
:
'
vite:uni-
quickapp-webview
'
,
name
:
'
uni:
quickapp-webview
'
,
config
()
{
config
()
{
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-stat/lib/uni.plugin.js
浏览文件 @
be36ec18
...
@@ -11,7 +11,7 @@ var index = [
...
@@ -11,7 +11,7 @@ var index = [
uniCliShared
.
defineUniMainJsPlugin
((
opts
)
=>
{
uniCliShared
.
defineUniMainJsPlugin
((
opts
)
=>
{
let
isEnable
=
false
;
let
isEnable
=
false
;
return
{
return
{
name
:
'
vite:uni-
stat
'
,
name
:
'
uni:
stat
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
config
(
config
,
env
)
{
config
(
config
,
env
)
{
if
(
isSsr
(
env
.
command
,
config
))
{
if
(
isSsr
(
env
.
command
,
config
))
{
...
@@ -46,7 +46,7 @@ var index = [
...
@@ -46,7 +46,7 @@ var index = [
}
}
});
});
}
}
debug__default
[
"
default
"
](
'
vite:
uni:stat
'
)(
'
isEnable
'
,
isEnable
);
debug__default
[
"
default
"
](
'
uni:stat
'
)(
'
isEnable
'
,
isEnable
);
process
.
env
.
UNI_STAT_TITLE_JSON
=
JSON
.
stringify
(
titlesJson
);
process
.
env
.
UNI_STAT_TITLE_JSON
=
JSON
.
stringify
(
titlesJson
);
return
{
return
{
define
:
{
define
:
{
...
...
packages/uni-stat/src/plugin/index.ts
浏览文件 @
be36ec18
...
@@ -12,7 +12,7 @@ export default [
...
@@ -12,7 +12,7 @@ export default [
defineUniMainJsPlugin
((
opts
)
=>
{
defineUniMainJsPlugin
((
opts
)
=>
{
let
isEnable
=
false
let
isEnable
=
false
return
{
return
{
name
:
'
vite:uni-
stat
'
,
name
:
'
uni:
stat
'
,
enforce
:
'
pre
'
,
enforce
:
'
pre
'
,
config
(
config
,
env
)
{
config
(
config
,
env
)
{
if
(
isSsr
(
env
.
command
,
config
))
{
if
(
isSsr
(
env
.
command
,
config
))
{
...
@@ -45,7 +45,7 @@ export default [
...
@@ -45,7 +45,7 @@ export default [
}
}
})
})
}
}
debug
(
'
vite:
uni:stat
'
)(
'
isEnable
'
,
isEnable
)
debug
(
'
uni:stat
'
)(
'
isEnable
'
,
isEnable
)
process
.
env
.
UNI_STAT_TITLE_JSON
=
JSON
.
stringify
(
titlesJson
)
process
.
env
.
UNI_STAT_TITLE_JSON
=
JSON
.
stringify
(
titlesJson
)
return
{
return
{
define
:
{
define
:
{
...
...
packages/vite-plugin-uni/bin/uni.js
浏览文件 @
be36ec18
...
@@ -8,13 +8,7 @@ const filterIndex = process.argv.findIndex((arg) =>
...
@@ -8,13 +8,7 @@ const filterIndex = process.argv.findIndex((arg) =>
if
(
debugIndex
>
0
)
{
if
(
debugIndex
>
0
)
{
let
value
=
process
.
argv
[
debugIndex
+
1
]
let
value
=
process
.
argv
[
debugIndex
+
1
]
if
(
!
value
||
value
.
startsWith
(
'
-
'
))
{
if
(
!
value
||
value
.
startsWith
(
'
-
'
))
{
value
=
'
vite:*
'
value
=
'
vite:*,uni:*
'
}
else
{
// support debugging multiple flags with comma-separated list
value
=
value
.
split
(
'
,
'
)
.
map
((
v
)
=>
`vite:
${
v
}
`
)
.
join
(
'
,
'
)
}
}
process
.
env
.
DEBUG
=
value
process
.
env
.
DEBUG
=
value
...
...
packages/vite-plugin-uni/src/configResolved/plugins/index.ts
浏览文件 @
be36ec18
...
@@ -16,7 +16,7 @@ import { uniPreVuePlugin } from './preVue'
...
@@ -16,7 +16,7 @@ import { uniPreVuePlugin } from './preVue'
import
{
uniSSRPlugin
}
from
'
./ssr
'
import
{
uniSSRPlugin
}
from
'
./ssr
'
import
{
uniResolveIdPlugin
}
from
'
./resolveId
'
import
{
uniResolveIdPlugin
}
from
'
./resolveId
'
const
debugPlugin
=
debug
(
'
vite:
uni:plugin
'
)
const
debugPlugin
=
debug
(
'
uni:plugin
'
)
export
interface
UniPluginFilterOptions
extends
VitePluginUniResolvedOptions
{
export
interface
UniPluginFilterOptions
extends
VitePluginUniResolvedOptions
{
include
?:
FilterPattern
include
?:
FilterPattern
...
...
packages/vite-plugin-uni/src/configResolved/plugins/json.ts
浏览文件 @
be36ec18
...
@@ -8,7 +8,7 @@ const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/
...
@@ -8,7 +8,7 @@ const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/
export
function
uniJsonPlugin
(
options
:
VitePluginUniResolvedOptions
):
Plugin
{
export
function
uniJsonPlugin
(
options
:
VitePluginUniResolvedOptions
):
Plugin
{
return
{
return
{
name
:
'
vite:uni-
json
'
,
name
:
'
uni:
json
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
jsonExtRE
.
test
(
id
))
return
null
if
(
!
jsonExtRE
.
test
(
id
))
return
null
if
(
SPECIAL_QUERY_RE
.
test
(
id
))
return
null
if
(
SPECIAL_QUERY_RE
.
test
(
id
))
return
null
...
...
packages/vite-plugin-uni/src/configResolved/plugins/pre.ts
浏览文件 @
be36ec18
...
@@ -12,9 +12,9 @@ import {
...
@@ -12,9 +12,9 @@ import {
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
import
{
UniPluginFilterOptions
}
from
'
.
'
import
{
UniPluginFilterOptions
}
from
'
.
'
const
debugPreJs
=
debug
(
'
vite:
uni:pre-js
'
)
const
debugPreJs
=
debug
(
'
uni:pre-js
'
)
const
debugPreHtml
=
debug
(
'
vite:
uni:pre-html
'
)
const
debugPreHtml
=
debug
(
'
uni:pre-html
'
)
const
debugPreJsTry
=
debug
(
'
vite:
uni:pre-js-try
'
)
const
debugPreJsTry
=
debug
(
'
uni:pre-js-try
'
)
const
PRE_JS_EXTNAME
=
[
'
.json
'
,
'
.css
'
].
concat
(
EXTNAME_VUE
).
concat
(
EXTNAME_JS
)
const
PRE_JS_EXTNAME
=
[
'
.json
'
,
'
.css
'
].
concat
(
EXTNAME_VUE
).
concat
(
EXTNAME_JS
)
const
PRE_HTML_EXTNAME
=
EXTNAME_VUE
const
PRE_HTML_EXTNAME
=
EXTNAME_VUE
...
@@ -25,7 +25,7 @@ export function uniPrePlugin(
...
@@ -25,7 +25,7 @@ export function uniPrePlugin(
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
return
{
return
{
name
:
'
vite:uni-
pre
'
,
name
:
'
uni:
pre
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
filter
(
id
))
{
if
(
!
filter
(
id
))
{
return
return
...
...
packages/vite-plugin-uni/src/configResolved/plugins/preCss.ts
浏览文件 @
be36ec18
...
@@ -5,8 +5,8 @@ import { preJs, withSourcemap } from '@dcloudio/uni-cli-shared'
...
@@ -5,8 +5,8 @@ import { preJs, withSourcemap } from '@dcloudio/uni-cli-shared'
import
{
UniPluginFilterOptions
}
from
'
.
'
import
{
UniPluginFilterOptions
}
from
'
.
'
const
debugPre
=
debug
(
'
vite:
uni:pre-css
'
)
const
debugPre
=
debug
(
'
uni:pre-css
'
)
const
debugPreTry
=
debug
(
'
vite:
uni:pre-css-try
'
)
const
debugPreTry
=
debug
(
'
uni:pre-css-try
'
)
const
cssLangs
=
`\\.(css|less|sass|scss|styl|stylus|postcss)($|\\?)`
const
cssLangs
=
`\\.(css|less|sass|scss|styl|stylus|postcss)($|\\?)`
const
cssLangRE
=
new
RegExp
(
cssLangs
)
const
cssLangRE
=
new
RegExp
(
cssLangs
)
/**
/**
...
@@ -19,7 +19,7 @@ export function uniPreCssPlugin(
...
@@ -19,7 +19,7 @@ export function uniPreCssPlugin(
):
Plugin
{
):
Plugin
{
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
return
{
return
{
name
:
'
vite:uni-
pre-css
'
,
name
:
'
uni:
pre-css
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
cssLangRE
.
test
(
id
))
{
if
(
!
cssLangRE
.
test
(
id
))
{
return
return
...
...
packages/vite-plugin-uni/src/configResolved/plugins/preVue.ts
浏览文件 @
be36ec18
...
@@ -21,7 +21,7 @@ import {
...
@@ -21,7 +21,7 @@ import {
parseVue
,
parseVue
,
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
const
debugPreVue
=
debug
(
'
vite:
uni:pre-vue
'
)
const
debugPreVue
=
debug
(
'
uni:pre-vue
'
)
const
BLOCK_RE
=
/<
\/
block>/
const
BLOCK_RE
=
/<
\/
block>/
...
@@ -31,7 +31,7 @@ const WXS_ATTRS = ['wxs', 'renderjs']
...
@@ -31,7 +31,7 @@ const WXS_ATTRS = ['wxs', 'renderjs']
export
function
uniPreVuePlugin
():
Plugin
{
export
function
uniPreVuePlugin
():
Plugin
{
return
{
return
{
name
:
'
vite:uni-
pre-vue
'
,
name
:
'
uni:
pre-vue
'
,
async
transform
(
code
,
id
)
{
async
transform
(
code
,
id
)
{
const
{
filename
,
query
}
=
parseVueRequest
(
id
)
const
{
filename
,
query
}
=
parseVueRequest
(
id
)
if
(
query
.
vue
)
{
if
(
query
.
vue
)
{
...
...
packages/vite-plugin-uni/src/configResolved/plugins/resolveId.ts
浏览文件 @
be36ec18
...
@@ -5,7 +5,7 @@ import { resolveBuiltIn } from '@dcloudio/uni-cli-shared'
...
@@ -5,7 +5,7 @@ import { resolveBuiltIn } from '@dcloudio/uni-cli-shared'
import
{
VitePluginUniResolvedOptions
}
from
'
../..
'
import
{
VitePluginUniResolvedOptions
}
from
'
../..
'
const
debugResolve
=
debug
(
'
vite:uni:resolve
'
)
const
debugResolve
=
debug
(
'
uni:resolve-id
'
)
const
BUILT_IN_MODULES
=
{
const
BUILT_IN_MODULES
=
{
'
vue-router
'
:
'
dist/vue-router.esm-bundler.js
'
,
'
vue-router
'
:
'
dist/vue-router.esm-bundler.js
'
,
...
@@ -25,7 +25,7 @@ export function uniResolveIdPlugin(
...
@@ -25,7 +25,7 @@ export function uniResolveIdPlugin(
):
Plugin
{
):
Plugin
{
const
resolveCache
:
Record
<
string
,
string
>
=
{}
const
resolveCache
:
Record
<
string
,
string
>
=
{}
return
{
return
{
name
:
'
vite:uni-
resolve-id
'
,
name
:
'
uni:
resolve-id
'
,
resolveId
(
id
)
{
resolveId
(
id
)
{
const
cache
=
resolveCache
[
id
]
const
cache
=
resolveCache
[
id
]
if
(
cache
)
{
if
(
cache
)
{
...
...
packages/vite-plugin-uni/src/configResolved/plugins/ssr.ts
浏览文件 @
be36ec18
...
@@ -15,7 +15,7 @@ import {
...
@@ -15,7 +15,7 @@ import {
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
import
{
UniPluginFilterOptions
}
from
'
.
'
import
{
UniPluginFilterOptions
}
from
'
.
'
const
debugSSR
=
debug
(
'
vite:
uni:ssr
'
)
const
debugSSR
=
debug
(
'
uni:ssr
'
)
const
KEYED_FUNC_RE
=
/
(
ssrRef|shallowSsrRef
)
/
const
KEYED_FUNC_RE
=
/
(
ssrRef|shallowSsrRef
)
/
...
@@ -25,7 +25,7 @@ export function uniSSRPlugin(
...
@@ -25,7 +25,7 @@ export function uniSSRPlugin(
):
Plugin
{
):
Plugin
{
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
return
{
return
{
name
:
'
vite:uni-
ssr
'
,
name
:
'
uni:
ssr
'
,
transform
(
code
,
id
)
{
transform
(
code
,
id
)
{
if
(
!
filter
(
id
))
return
null
if
(
!
filter
(
id
))
return
null
if
(
!
KEYED_FUNC_RE
.
test
(
code
))
{
if
(
!
KEYED_FUNC_RE
.
test
(
code
))
{
...
...
packages/vite-plugin-uni/src/configResolved/plugins/static.ts
浏览文件 @
be36ec18
...
@@ -5,7 +5,7 @@ import { cleanUrl } from '@dcloudio/uni-cli-shared'
...
@@ -5,7 +5,7 @@ import { cleanUrl } from '@dcloudio/uni-cli-shared'
import
{
UniPluginFilterOptions
}
from
'
.
'
import
{
UniPluginFilterOptions
}
from
'
.
'
import
{
createPublicFileFilter
}
from
'
../../utils
'
import
{
createPublicFileFilter
}
from
'
../../utils
'
const
debugStatic
=
debug
(
'
vite:
uni:static
'
)
const
debugStatic
=
debug
(
'
uni:static
'
)
/**
/**
* 提供static等目录静态资源加载
* 提供static等目录静态资源加载
* @param _options
* @param _options
...
@@ -18,7 +18,7 @@ export function uniStaticPlugin(
...
@@ -18,7 +18,7 @@ export function uniStaticPlugin(
):
Plugin
{
):
Plugin
{
const
filter
=
createPublicFileFilter
()
const
filter
=
createPublicFileFilter
()
return
{
return
{
name
:
'
vite:uni-
static
'
,
name
:
'
uni:
static
'
,
resolveId
(
id
)
{
resolveId
(
id
)
{
if
(
!
config
.
assetsInclude
(
cleanUrl
(
id
)))
{
if
(
!
config
.
assetsInclude
(
cleanUrl
(
id
)))
{
return
return
...
...
packages/vite-plugin-uni/src/index.ts
浏览文件 @
be36ec18
...
@@ -29,7 +29,7 @@ import {
...
@@ -29,7 +29,7 @@ import {
}
from
'
./vue
'
}
from
'
./vue
'
// import { createResolveId } from './resolveId'
// import { createResolveId } from './resolveId'
const
debugUni
=
debug
(
'
vite:
uni:plugin
'
)
const
debugUni
=
debug
(
'
uni:plugin
'
)
const
pkg
=
require
(
path
.
resolve
(
__dirname
,
'
../package.json
'
))
const
pkg
=
require
(
path
.
resolve
(
__dirname
,
'
../package.json
'
))
...
@@ -114,7 +114,7 @@ export default function uniPlugin(
...
@@ -114,7 +114,7 @@ export default function uniPlugin(
}
}
plugins
.
push
({
plugins
.
push
({
name
:
'
vite:
uni
'
,
name
:
'
uni
'
,
config
:
createConfig
(
options
,
uniPlugins
),
config
:
createConfig
(
options
,
uniPlugins
),
// resolveId: createResolveId(options),
// resolveId: createResolveId(options),
configResolved
:
createConfigResolved
(
options
),
configResolved
:
createConfigResolved
(
options
),
...
...
packages/vite-plugin-uni/src/plugins/copy.ts
浏览文件 @
be36ec18
...
@@ -13,7 +13,7 @@ import {
...
@@ -13,7 +13,7 @@ import {
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
import
{
VitePluginUniResolvedOptions
}
from
'
..
'
import
{
VitePluginUniResolvedOptions
}
from
'
..
'
const
debugCopy
=
debug
(
'
vite:
uni:copy
'
)
const
debugCopy
=
debug
(
'
uni:copy
'
)
export
function
uniCopyPlugin
({
export
function
uniCopyPlugin
({
outputDir
,
outputDir
,
...
...
packages/vite-plugin-uni/src/utils/easycom.ts
浏览文件 @
be36ec18
...
@@ -7,7 +7,7 @@ import {
...
@@ -7,7 +7,7 @@ import {
resolveComponentsLibPath
,
resolveComponentsLibPath
,
}
from
'
@dcloudio/uni-cli-shared
'
}
from
'
@dcloudio/uni-cli-shared
'
const
debugEasycom
=
debug
(
'
vite:
uni:easycom
'
)
const
debugEasycom
=
debug
(
'
uni:easycom
'
)
export
const
initEasycom
=
(
watcher
?:
FSWatcher
)
=>
{
export
const
initEasycom
=
(
watcher
?:
FSWatcher
)
=>
{
const
{
filter
,
refresh
,
options
}
=
initEasycomsOnce
(
const
{
filter
,
refresh
,
options
}
=
initEasycomsOnce
(
process
.
env
.
UNI_INPUT_DIR
,
process
.
env
.
UNI_INPUT_DIR
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录