From ca26f4ab9baa72cc0fa80db05245a5ca69f9873a Mon Sep 17 00:00:00 2001 From: Mater Date: Mon, 9 Dec 2024 19:44:46 +0800 Subject: [PATCH 1/5] Update index.js --- packages/webpack-plugin/lib/platform/template/wx/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webpack-plugin/lib/platform/template/wx/index.js b/packages/webpack-plugin/lib/platform/template/wx/index.js index cc6335c64..071c35d96 100644 --- a/packages/webpack-plugin/lib/platform/template/wx/index.js +++ b/packages/webpack-plugin/lib/platform/template/wx/index.js @@ -68,7 +68,7 @@ module.exports = function getSpec ({ warn, error }) { if (el) { const injectWxsProp = { injectWxsPath: '~' + normalize.lib('runtime/swanHelper.wxs'), - injectWxsModuleName: '__swanHelper__' + injectWxsModuleName: 'swanHelper__' } if (el.injectWxsProps && Array.isArray(el.injectWxsProps)) { el.injectWxsProps.push(injectWxsProp) @@ -78,7 +78,7 @@ module.exports = function getSpec ({ warn, error }) { } return { name: 's-for', - value: `${itemName}, ${indexName} in __swanHelper__.processFor(${listName})${keyStr}` + value: `${itemName}, ${indexName} in swanHelper__.processFor(${listName})${keyStr}` } }, web ({ value }, { el }) { From 8dc207107b62f5410d634cd8528a7a27756d2d6c Mon Sep 17 00:00:00 2001 From: Mater Date: Mon, 9 Dec 2024 19:45:14 +0800 Subject: [PATCH 2/5] Update common.spec.js --- .../webpack-plugin/test/platform/wx/template/common.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webpack-plugin/test/platform/wx/template/common.spec.js b/packages/webpack-plugin/test/platform/wx/template/common.spec.js index 14c6277a4..548aa8d46 100644 --- a/packages/webpack-plugin/test/platform/wx/template/common.spec.js +++ b/packages/webpack-plugin/test/platform/wx/template/common.spec.js @@ -29,9 +29,9 @@ describe('common spec case', function () { const output2 = compileTemplate(input2, { srcMode: 'wx', mode: 'swan' }) const output3 = compileTemplate(input3, { srcMode: 'wx', mode: 'swan' }) const wxsPath = lib('runtime/swanHelper.wxs') - expect(output1).toBe(`123`) - expect(output2).toBe(`123`) - expect(output3).toBe(`123`) + expect(output1).toBe(`123`) + expect(output2).toBe(`123`) + expect(output3).toBe(`123`) }) it('should wrap directive expression in swan', function () { From 1496b1b28155dd4ccba91eca53bf8753ffff7bdd Mon Sep 17 00:00:00 2001 From: Mater Date: Mon, 9 Dec 2024 19:45:26 +0800 Subject: [PATCH 3/5] Update common.spec.js --- .../webpack-plugin/test/platform/wx/template/common.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webpack-plugin/test/platform/wx/template/common.spec.js b/packages/webpack-plugin/test/platform/wx/template/common.spec.js index 548aa8d46..478f5071c 100644 --- a/packages/webpack-plugin/test/platform/wx/template/common.spec.js +++ b/packages/webpack-plugin/test/platform/wx/template/common.spec.js @@ -29,9 +29,9 @@ describe('common spec case', function () { const output2 = compileTemplate(input2, { srcMode: 'wx', mode: 'swan' }) const output3 = compileTemplate(input3, { srcMode: 'wx', mode: 'swan' }) const wxsPath = lib('runtime/swanHelper.wxs') - expect(output1).toBe(`123`) - expect(output2).toBe(`123`) - expect(output3).toBe(`123`) + expect(output1).toBe(`123`) + expect(output2).toBe(`123`) + expect(output3).toBe(`123`) }) it('should wrap directive expression in swan', function () { From 74ac842d211c131b8758133bd9b875a12c2d7d39 Mon Sep 17 00:00:00 2001 From: Mater Date: Tue, 10 Dec 2024 19:10:57 +0800 Subject: [PATCH 4/5] Update index.js --- packages/webpack-plugin/lib/platform/template/wx/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webpack-plugin/lib/platform/template/wx/index.js b/packages/webpack-plugin/lib/platform/template/wx/index.js index 071c35d96..3c342cc61 100644 --- a/packages/webpack-plugin/lib/platform/template/wx/index.js +++ b/packages/webpack-plugin/lib/platform/template/wx/index.js @@ -68,7 +68,7 @@ module.exports = function getSpec ({ warn, error }) { if (el) { const injectWxsProp = { injectWxsPath: '~' + normalize.lib('runtime/swanHelper.wxs'), - injectWxsModuleName: 'swanHelper__' + injectWxsModuleName: 'mpxSwanHelper' } if (el.injectWxsProps && Array.isArray(el.injectWxsProps)) { el.injectWxsProps.push(injectWxsProp) @@ -78,7 +78,7 @@ module.exports = function getSpec ({ warn, error }) { } return { name: 's-for', - value: `${itemName}, ${indexName} in swanHelper__.processFor(${listName})${keyStr}` + value: `${itemName}, ${indexName} in mpxSwanHelper.processFor(${listName})${keyStr}` } }, web ({ value }, { el }) { From 26004346f31bac944220dc8b8d5b75548fafc837 Mon Sep 17 00:00:00 2001 From: Mater Date: Tue, 10 Dec 2024 19:11:36 +0800 Subject: [PATCH 5/5] Update common.spec.js --- .../webpack-plugin/test/platform/wx/template/common.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webpack-plugin/test/platform/wx/template/common.spec.js b/packages/webpack-plugin/test/platform/wx/template/common.spec.js index 478f5071c..b40bbd5fc 100644 --- a/packages/webpack-plugin/test/platform/wx/template/common.spec.js +++ b/packages/webpack-plugin/test/platform/wx/template/common.spec.js @@ -29,9 +29,9 @@ describe('common spec case', function () { const output2 = compileTemplate(input2, { srcMode: 'wx', mode: 'swan' }) const output3 = compileTemplate(input3, { srcMode: 'wx', mode: 'swan' }) const wxsPath = lib('runtime/swanHelper.wxs') - expect(output1).toBe(`123`) - expect(output2).toBe(`123`) - expect(output3).toBe(`123`) + expect(output1).toBe(`123`) + expect(output2).toBe(`123`) + expect(output3).toBe(`123`) }) it('should wrap directive expression in swan', function () {