cli 小程序引入模版前缀改
This commit is contained in:
parent
7435b20e3c
commit
d490a4596c
|
|
@ -196,9 +196,9 @@ exports.projectConfigContentWithWeChatMp = projectConfigContentWithWeChatMp;
|
||||||
function appJsonContentWithWeChatMp(isDev) {
|
function appJsonContentWithWeChatMp(isDev) {
|
||||||
const pages = [];
|
const pages = [];
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
pages.push('oak#pages/address/list/index');
|
pages.push('@oak-general-business/address/list/index');
|
||||||
pages.push('oak#pages/address/upsert/index');
|
pages.push('@oak-general-business/address/upsert/index');
|
||||||
pages.push('oak#pages/pickers/area/index');
|
pages.push('@oak-general-business/pickers/area/index');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pages.push('pages/index/index');
|
pages.push('pages/index/index');
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ const ensurePosix = require('ensure-posix-path');
|
||||||
const requiredPath = require('required-path');
|
const requiredPath = require('required-path');
|
||||||
|
|
||||||
const pluginName = 'OakWeChatMpPlugin';
|
const pluginName = 'OakWeChatMpPlugin';
|
||||||
const oakPagePrefix = 'oak#';
|
const oakPagePrefix = '@oak-general-business';
|
||||||
const oakPagePath = 'node_modules/oak-general-business/src/platforms/wechatMp/';
|
const oakPagePath = 'node_modules/oak-general-business/src/platforms/wechatMp/';
|
||||||
// const oakPagePathRegExp = /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 instance;
|
||||||
let isOak = getIsOak(page);
|
let isOak = getIsOak(page);
|
||||||
if (isOak) {
|
if (isOak) {
|
||||||
const oakPage = page.replace(
|
const oakPage = oakPagePath + page.replace(
|
||||||
new RegExp(oakPagePrefix),
|
new RegExp(oakPagePrefix),
|
||||||
oakPagePath
|
'pages'
|
||||||
);
|
);
|
||||||
instance = path.resolve(process.cwd(), oakPage);
|
instance = path.resolve(process.cwd(), oakPage);
|
||||||
if (!this.oakPages.has(oakPage)) {
|
if (!this.oakPages.has(oakPage)) {
|
||||||
|
|
@ -270,7 +270,7 @@ class OakWeChatMpPlugin {
|
||||||
.resolve(instanceDir, c)
|
.resolve(instanceDir, c)
|
||||||
.replace(/\\/g, '/');
|
.replace(/\\/g, '/');
|
||||||
const component2 = component.replace(
|
const component2 = component.replace(
|
||||||
process.cwd() + '/',
|
process.cwd().replace(/\\/g, '/') + '/',
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
if (!this.oakComponents.has(component2)) {
|
if (!this.oakComponents.has(component2)) {
|
||||||
|
|
@ -519,7 +519,10 @@ class OakWeChatMpPlugin {
|
||||||
let isOak = getIsOak(page);
|
let isOak = getIsOak(page);
|
||||||
|
|
||||||
if (isOak) {
|
if (isOak) {
|
||||||
page = page.replace(new RegExp(oakPagePrefix), '');
|
page = page.replace(
|
||||||
|
new RegExp(oakPagePrefix),
|
||||||
|
'pages'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
pages.push(page);
|
pages.push(page);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -207,9 +207,9 @@ export function projectConfigContentWithWeChatMp(
|
||||||
export function appJsonContentWithWeChatMp(isDev: boolean) {
|
export function appJsonContentWithWeChatMp(isDev: boolean) {
|
||||||
const pages = [];
|
const pages = [];
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
pages.push('oak#pages/address/list/index');
|
pages.push('@oak-general-business/address/list/index');
|
||||||
pages.push('oak#pages/address/upsert/index');
|
pages.push('@oak-general-business/address/upsert/index');
|
||||||
pages.push('oak#pages/pickers/area/index');
|
pages.push('@oak-general-business/pickers/area/index');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pages.push('pages/index/index');
|
pages.push('pages/index/index');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue