Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
f56f5198
U
uni-app
项目概览
DCloud
/
uni-app
14 天 前同步成功
通知
751
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f56f5198
编写于
4月 30, 2024
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip: uni_modules 编译模式
上级
7ce57d49
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
91 addition
and
109 deletion
+91
-109
packages/playground/__tests__/__snapshots__/uni_modules.spec.ts.snap
...ayground/__tests__/__snapshots__/uni_modules.spec.ts.snap
+80
-106
packages/playground/__tests__/uni_modules.spec.ts
packages/playground/__tests__/uni_modules.spec.ts
+7
-3
packages/playground/uni_modules/package.json
packages/playground/uni_modules/package.json
+1
-0
pnpm-lock.yaml
pnpm-lock.yaml
+3
-0
未找到文件。
packages/playground/__tests__/__snapshots__/uni_modules.spec.ts.snap
浏览文件 @
f56f5198
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`uni_modules playground uni-app-x build:app-ios 1`] = `
"import Logo from "./test-com1/components/test-com1-1/logo.png";
import { openBlock, createElementBlock, Fragment, createElementVNode, toDisplayString } from "vue";
import _export_sfc from "plugin-vue:export-helper";
const _sfc_main$1 = {
data() {
return {
msg: "test-com1-1",
logo: Logo
};
}
};
"import { defineComponent, openBlock, createElementBlock, Fragment, createElementVNode, toDisplayString } from 'vue';
import Logo from './test-com1/components/test-com1-1/logo.png';
import _export_sfc from 'plugin-vue:export-helper';
const _sfc_main$1 = defineComponent({
data() {
return {
msg: 'test-com1-1',
logo: Logo
};
}
});
const _style_0$1 = {"text":{"":{"color":"#FF0000"}}};
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock(Fragment, null, [
createElementVNode("text", { class: "text" }, toDisplayString($data.msg) + toDisplayString($data.logo), 1),
createElementVNode("image", { src: Logo })
], 64);
}
const testCom11 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
const _sfc_main = {
data() {
return {
msg: "test-com1-2",
logo: Logo
};
}
};
const testCom11 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["styles", [_style_0$1]]]);
const _sfc_main = defineComponent({
data() {
return {
msg: 'test-com1-2',
logo: Logo
};
}
});
const _style_0 = {"text2":{"":{"color":"#FF0000"}}};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock(Fragment, null, [
createElementVNode("text", { class: "text2" }, toDisplayString($data.msg) + toDisplayString($data.logo), 1),
createElementVNode("image", { src: Logo })
], 64);
}
const testCom12 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
testCom11 as TestCom11,
testCom12 as TestCom12
};
const testCom12 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]]]);
export { testCom11 as TestCom11, testCom12 as TestCom12 };
"
`;
exports[`uni_modules playground uni-app-x build:app-ios 2`] = `
"import Logo from "./test-com2/components/test-com2-1/logo.png";
import { openBlock, createElementBlock, toDisplayString } from "vue";
import _export_sfc from "plugin-vue:export-helper";
const _sfc_main$1 = {
data() {
return {
msg: "test-com2-1",
logo: Logo
};
}
};
"import { defineComponent, openBlock, createElementBlock, toDisplayString } from 'vue';
import Logo from './test-com2/components/test-com2-1/logo.png';
import _export_sfc from 'plugin-vue:export-helper';
const _sfc_main$1 = defineComponent({
data() {
return {
msg: 'test-com2-1',
logo: Logo
};
}
});
const _style_0$1 = {"text":{"":{"color":"#FF0000"}}};
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("text", { class: "text" }, toDisplayString($data.msg) + toDisplayString($data.logo), 1);
}
const testCom21 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
const _sfc_main = {
data() {
return {
msg: "test-com2-2",
logo: Logo
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("text", { class: "text2" }, toDisplayString($data.msg) + toDisplayString($data.logo), 1);
}
const testCom22 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
testCom21 as TestCom21,
testCom22 as TestCom22
};
"
`;
const testCom21 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["styles", [_style_0$1]]]);
exports[`uni_modules playground uni-app-x build:app-ios 3`] = `
"
.text {
color: red;
}
.image {
background: url('@/uni_modules/test-com1/components/test-com1-1/logo.png');
}
"
`;
const _sfc_main = defineComponent({
data() {
return {
msg: 'test-com2-2',
logo: Logo
};
}
});
exports[`uni_modules playground uni-app-x build:app-ios 4`] = `
"
.text2 {
color: red;
}
"
`;
const _style_0 = {"text2":{"":{"color":"#FF0000"}}};
exports[`uni_modules playground uni-app-x build:app-ios 5`] = `
"
.text {
color: red;
}
.image {
background: url('@/uni_modules/test-com2/components/test-com2-1/logo.png');
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("text", { class: "text2" }, toDisplayString($data.msg) + toDisplayString($data.logo), 1);
}
"
`;
const testCom22 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]]]);
exports[`uni_modules playground uni-app-x build:app-ios 6`] = `
"
.text2 {
color: red;
}
export { testCom21 as TestCom21, testCom22 as TestCom22 };
"
`;
...
...
@@ -119,17 +93,17 @@ exports[`uni_modules playground uni-app-x build:h5 1`] = `
import { Text, Image } from "@dcloudio/uni-h5";
import "@dcloudio/uni-components/style/image.css";
import "@dcloudio/uni-components/style/resize-sensor.css";
import { defineComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createTextVNode, toDisplayString } from "vue";
import Logo from "./test-com1/components/test-com1-1/logo.png";
import { openBlock, createElementBlock, Fragment, createVNode, withCtx, createTextVNode, toDisplayString } from "vue";
import _export_sfc from "plugin-vue:export-helper";
const _sfc_main$1 = {
const _sfc_main$1 =
defineComponent(
{
data() {
return {
msg: "test-com1-1",
logo: Logo
};
}
};
}
)
;
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
const _component_v_uni_text = Text;
const _component_v_uni_image = Image;
...
...
@@ -143,15 +117,15 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
createVNode(_component_v_uni_image, { src: Logo })
], 64);
}
const testCom11 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
a4ecbcc3
"]]);
const _sfc_main = {
const testCom11 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
14e59d16
"]]);
const _sfc_main =
defineComponent(
{
data() {
return {
msg: "test-com1-2",
logo: Logo
};
}
};
}
)
;
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_v_uni_text = Text;
const _component_v_uni_image = Image;
...
...
@@ -165,7 +139,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
createVNode(_component_v_uni_image, { src: Logo })
], 64);
}
const testCom12 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
4d21cdc3
"]]);
const testCom12 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
3c9048c8
"]]);
export {
testCom11 as TestCom11,
testCom12 as TestCom12
...
...
@@ -176,17 +150,17 @@ export {
exports[`uni_modules playground uni-app-x build:h5 2`] = `
"import "@dcloudio/uni-components/style/text.css";
import { Text } from "@dcloudio/uni-h5";
import { defineComponent, openBlock, createBlock, withCtx, createTextVNode, toDisplayString } from "vue";
import Logo from "./test-com2/components/test-com2-1/logo.png";
import { openBlock, createBlock, withCtx, createTextVNode, toDisplayString } from "vue";
import _export_sfc from "plugin-vue:export-helper";
const _sfc_main$1 = {
const _sfc_main$1 =
defineComponent(
{
data() {
return {
msg: "test-com2-1",
logo: Logo
};
}
};
}
)
;
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
const _component_v_uni_text = Text;
return openBlock(), createBlock(_component_v_uni_text, { class: "text" }, {
...
...
@@ -196,15 +170,15 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
_: 1
});
}
const testCom21 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
f33122a3
"]]);
const _sfc_main = {
const testCom21 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
75bce91a
"]]);
const _sfc_main =
defineComponent(
{
data() {
return {
msg: "test-com2-2",
logo: Logo
};
}
};
}
)
;
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_v_uni_text = Text;
return openBlock(), createBlock(_component_v_uni_text, { class: "text2" }, {
...
...
@@ -214,7 +188,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
_: 1
});
}
const testCom22 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
ac423ad8
"]]);
const testCom22 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
6088c0cc
"]]);
export {
testCom21 as TestCom21,
testCom22 as TestCom22
...
...
@@ -227,10 +201,10 @@ exports[`uni_modules playground uni-app-x build:h5 3`] = `
.text[data-v-
a4ecbcc3
] {
.text[data-v-
14e59d16
] {
color: red;
}
.image[data-v-
a4ecbcc3
] {
.image[data-v-
14e59d16
] {
background: url('@/uni_modules/test-com1/components/test-com1-1/logo.png');
}
"
...
...
@@ -241,7 +215,7 @@ exports[`uni_modules playground uni-app-x build:h5 4`] = `
.text2[data-v-
4d21cdc3
] {
.text2[data-v-
3c9048c8
] {
color: red;
}
"
...
...
@@ -250,10 +224,10 @@ exports[`uni_modules playground uni-app-x build:h5 4`] = `
exports[`uni_modules playground uni-app-x build:h5 5`] = `
"
.text[data-v-
f33122a3
] {
.text[data-v-
75bce91a
] {
color: red;
}
.image[data-v-
f33122a3
] {
.image[data-v-
75bce91a
] {
background: url('@/uni_modules/test-com2/components/test-com2-1/logo.png');
}
"
...
...
@@ -262,7 +236,7 @@ exports[`uni_modules playground uni-app-x build:h5 5`] = `
exports[`uni_modules playground uni-app-x build:h5 6`] = `
"
.text2[data-v-
ac423ad8
] {
.text2[data-v-
6088c0cc
] {
color: red;
}
"
...
...
packages/playground/__tests__/uni_modules.spec.ts
浏览文件 @
f56f5198
import
fs
from
'
fs
'
import
fs
from
'
fs
-extra
'
import
path
from
'
path
'
import
execa
from
'
execa
'
import
{
sync
}
from
'
fast-glob
'
...
...
@@ -32,13 +32,16 @@ describe('uni_modules playground', () => {
// 'build:mp-weixin',
],
}
const
distDir
=
path
.
resolve
(
projectDir
,
'
dist
'
)
if
(
fs
.
existsSync
(
distDir
))
{
fs
.
emptyDirSync
(
distDir
)
}
Object
.
keys
(
modes
).
forEach
((
mode
)
=>
{
const
scripts
=
modes
[
mode
]
scripts
.
forEach
((
script
)
=>
{
test
(
`
${
mode
}
${
script
}
`
,
async
()
=>
{
const
outDir
=
path
.
resolve
(
projectDir
,
'
dist
'
,
distDir
,
'
build
'
,
mode
,
script
.
replace
(
'
build:
'
,
''
)
...
...
@@ -49,6 +52,7 @@ describe('uni_modules playground', () => {
...
process
.
env
,
UNI_OUTPUT_DIR
:
outDir
,
UNI_COMPILE_TARGET
:
'
uni_modules
'
,
UNI_APP_X
:
mode
===
'
uni-app-x
'
?
'
true
'
:
'
false
'
,
},
})
sync
(
'
**/*
'
,
{
cwd
:
outDir
,
absolute
:
true
}).
forEach
((
file
)
=>
{
...
...
packages/playground/uni_modules/package.json
浏览文件 @
f56f5198
...
...
@@ -57,6 +57,7 @@
},
"devDependencies"
:
{
"@dcloudio/uni-cli-shared"
:
"../../uni-cli-shared"
,
"@dcloudio/uni-uts-v1"
:
"../../uni-uts-v1"
,
"@dcloudio/vite-plugin-uni"
:
"../../vite-plugin-uni"
,
"vite"
:
"^5.2.8"
},
...
...
pnpm-lock.yaml
浏览文件 @
f56f5198
...
...
@@ -314,6 +314,9 @@ importers:
'
@dcloudio/uni-cli-shared'
:
specifier
:
../../uni-cli-shared
version
:
link:../../uni-cli-shared
'
@dcloudio/uni-uts-v1'
:
specifier
:
../../uni-uts-v1
version
:
link:../../uni-uts-v1
'
@dcloudio/vite-plugin-uni'
:
specifier
:
../../vite-plugin-uni
version
:
link:../../vite-plugin-uni
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录