diff --git a/lib/template.js b/lib/template.js index f8b4c28..b006bf8 100644 --- a/lib/template.js +++ b/lib/template.js @@ -196,9 +196,9 @@ exports.projectConfigContentWithWeChatMp = projectConfigContentWithWeChatMp; function appJsonContentWithWeChatMp(isDev) { const pages = []; if (isDev) { - pages.push('oak#pages/address/list/index'); - pages.push('oak#pages/address/upsert/index'); - pages.push('oak#pages/pickers/area/index'); + pages.push('@oak-general-business/address/list/index'); + pages.push('@oak-general-business/address/upsert/index'); + pages.push('@oak-general-business/pickers/area/index'); } else { pages.push('pages/index/index'); diff --git a/plugins/WechatMpPlugin.js b/plugins/WechatMpPlugin.js index b5b3882..c29b680 100644 --- a/plugins/WechatMpPlugin.js +++ b/plugins/WechatMpPlugin.js @@ -16,7 +16,7 @@ const ensurePosix = require('ensure-posix-path'); const requiredPath = require('required-path'); const pluginName = 'OakWeChatMpPlugin'; -const oakPagePrefix = 'oak#'; +const oakPagePrefix = '@oak-general-business'; const oakPagePath = 'node_modules/oak-general-business/src/platforms/wechatMp/'; // const oakPagePathRegExp = /node_modules\/oak-general-business\/src\/platforms\/wechatMp\//; @@ -197,9 +197,9 @@ class OakWeChatMpPlugin { let instance; let isOak = getIsOak(page); if (isOak) { - const oakPage = page.replace( + const oakPage = oakPagePath + page.replace( new RegExp(oakPagePrefix), - oakPagePath + 'pages' ); instance = path.resolve(process.cwd(), oakPage); if (!this.oakPages.has(oakPage)) { @@ -270,7 +270,7 @@ class OakWeChatMpPlugin { .resolve(instanceDir, c) .replace(/\\/g, '/'); const component2 = component.replace( - process.cwd() + '/', + process.cwd().replace(/\\/g, '/') + '/', '' ); if (!this.oakComponents.has(component2)) { @@ -519,7 +519,10 @@ class OakWeChatMpPlugin { let isOak = getIsOak(page); if (isOak) { - page = page.replace(new RegExp(oakPagePrefix), ''); + page = page.replace( + new RegExp(oakPagePrefix), + 'pages' + ); } pages.push(page); } diff --git a/src/template.ts b/src/template.ts index 048962d..e71a573 100644 --- a/src/template.ts +++ b/src/template.ts @@ -207,9 +207,9 @@ export function projectConfigContentWithWeChatMp( export function appJsonContentWithWeChatMp(isDev: boolean) { const pages = []; if (isDev) { - pages.push('oak#pages/address/list/index'); - pages.push('oak#pages/address/upsert/index'); - pages.push('oak#pages/pickers/area/index'); + pages.push('@oak-general-business/address/list/index'); + pages.push('@oak-general-business/address/upsert/index'); + pages.push('@oak-general-business/pickers/area/index'); } else { pages.push('pages/index/index');