@wevu/compiler 6.15.14 → 6.15.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +10 -3
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -6618,7 +6618,7 @@ function transformIfElement(node, context, transformNode) {
|
|
|
6618
6618
|
};
|
|
6619
6619
|
const slotDirective = findSlotDirective(elementWithoutIf);
|
|
6620
6620
|
const templateSlotChildren = elementWithoutIf.children.filter((child) => child.type === NodeTypes.ELEMENT && child.tag === "template" && findSlotDirective(child));
|
|
6621
|
-
const content = slotDirective || templateSlotChildren.length > 0 ? transformComponentWithSlots(elementWithoutIf, context, transformNode) : transformNormalElement(elementWithoutIf, context, transformNode);
|
|
6621
|
+
const content = elementWithoutIf.tag === "slot" ? transformSlotElement(elementWithoutIf, context, transformNode) : slotDirective || templateSlotChildren.length > 0 ? transformComponentWithSlots(elementWithoutIf, context, transformNode) : transformNormalElement(elementWithoutIf, context, transformNode);
|
|
6622
6622
|
const dir = ifDirective;
|
|
6623
6623
|
if (dir.name === "if" && dir.exp) {
|
|
6624
6624
|
const expValue = resolveConditionExpression$1(dir.exp.type === NodeTypes.SIMPLE_EXPRESSION ? dir.exp.content : "", context, "v-if");
|
|
@@ -6764,7 +6764,11 @@ function transformTemplateElement(node, context, transformNode) {
|
|
|
6764
6764
|
function transformElement(node, context, transformNode) {
|
|
6765
6765
|
const { tag } = node;
|
|
6766
6766
|
if (tag === "template") return transformTemplateElement(node, context, transformNode);
|
|
6767
|
-
if (tag === "slot")
|
|
6767
|
+
if (tag === "slot") {
|
|
6768
|
+
const { type } = isStructuralDirective(node);
|
|
6769
|
+
if (type === "if") return transformIfElement(node, context, transformNode);
|
|
6770
|
+
return transformSlotElement(node, context, transformNode);
|
|
6771
|
+
}
|
|
6768
6772
|
if (tag === "component") return transformComponentElement(node, context, transformNode);
|
|
6769
6773
|
if (tag === "transition") return transformTransitionElement(node, context, transformNode);
|
|
6770
6774
|
if (tag === "keep-alive") return transformKeepAliveElement(node, context, transformNode);
|
|
@@ -7718,7 +7722,10 @@ function compileTemplatePhase(descriptor, filename, options, result) {
|
|
|
7718
7722
|
*/
|
|
7719
7723
|
async function compileVueFile(source, filename, options) {
|
|
7720
7724
|
const parsed = await parseVueFile(source, filename, options);
|
|
7721
|
-
const result = { meta: {
|
|
7725
|
+
const result = { meta: {
|
|
7726
|
+
...parsed.meta,
|
|
7727
|
+
styleBlocks: parsed.descriptor.styles
|
|
7728
|
+
} };
|
|
7722
7729
|
const autoUsingComponents = options?.autoUsingComponents?.enabled && parsed.descriptor.scriptSetup && parsed.descriptor.template && options.autoUsingComponents.resolveUsingComponentPath ? options.autoUsingComponents : void 0;
|
|
7723
7730
|
const autoImportTags = options?.autoImportTags?.enabled && parsed.descriptor.template && options.autoImportTags.resolveUsingComponent ? options.autoImportTags : void 0;
|
|
7724
7731
|
const templateCompiled = compileTemplatePhase(parsed.descriptor, filename, options?.template, result);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wevu/compiler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.15.
|
|
4
|
+
"version": "6.15.16",
|
|
5
5
|
"description": "wevu 编译器基础包,面向小程序模板的编译与转换",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vue": "^3.5.33",
|
|
53
53
|
"@weapp-core/constants": "^0.1.2",
|
|
54
54
|
"@weapp-core/shared": "3.0.4",
|
|
55
|
-
"@weapp-vite/ast": "6.15.
|
|
55
|
+
"@weapp-vite/ast": "6.15.16",
|
|
56
56
|
"rolldown-require": "2.0.15"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|