diff --git a/packages/wxa-plugin-replace/index.js b/packages/wxa-plugin-replace/index.js index 9418707f31ec3ea4558425b56718cd9462579107..27e9ead4b64ce8dd440d9f02432ea6dbaa5318eb 100644 --- a/packages/wxa-plugin-replace/index.js +++ b/packages/wxa-plugin-replace/index.js @@ -38,7 +38,7 @@ module.exports = class ReplacePlugin { mapConfigsToWxa(configs) { if(configs == null) return []; - return Object.keys(configs).reduce((ret, name, idx)=>{ + return Object.keys(configs).sort((a, b) => b.length - a.length).reduce((ret, name, idx)=>{ ret.push({ regular: new RegExp(name, this.configs.flag), value: configs[name],