diff --git a/packages/webpack-plugin/lib/platform/template/wx/index.js b/packages/webpack-plugin/lib/platform/template/wx/index.js index cc6335c64..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 }) { 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..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 () {