调整locales的build
This commit is contained in:
parent
5c2e00a65f
commit
01d94d0915
|
|
@ -5,7 +5,7 @@ const Path = require('path');
|
|||
const { merge, get, set, setWith } = require('lodash');
|
||||
|
||||
const oakRegex =
|
||||
/(\/*[a-zA-Z0-9_-])*\/app\/(pages|components|locales)+\/|(\\*[a-zA-Z0-9_-])*\\app\\(pages|components|locales)+\\/;
|
||||
/(\/*[a-zA-Z0-9_-])*\/lib\/(pages|components|locales)+\/|(\\*[a-zA-Z0-9_-])*\\lib\\(pages|components|locales)+\\/;
|
||||
const localRegex =
|
||||
/(\/*[a-zA-Z0-9_-])*\/src\/(pages|components|locales)+\/|(\\*[a-zA-Z0-9_-])*\\src\/(pages|components|locales)+\\/;
|
||||
|
||||
|
|
@ -39,14 +39,12 @@ function getNameAndLng(path) {
|
|||
}
|
||||
|
||||
function buildLocales({
|
||||
projectPath,
|
||||
businessProjectPath,
|
||||
projectPaths,
|
||||
buildPath,
|
||||
nodeEnv,
|
||||
platform,
|
||||
}) {
|
||||
const dataJson = {};
|
||||
const projectPaths = [projectPath, businessProjectPath];
|
||||
projectPaths.forEach((path) => {
|
||||
readProject(dataJson, path, buildPath, nodeEnv, platform);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ function copyLocaleFiles() {
|
|||
// locales到mp/dist下
|
||||
const buildPath = Path.resolve(paths.appSrc, Locales);
|
||||
const json = buildLocales({
|
||||
projectPath: paths.appRootSrc,
|
||||
businessProjectPath: paths.oakGeneralBusinessAppPath,
|
||||
projectPaths: [paths.appRootSrc, paths.oakGeneralBusinessAppPath],
|
||||
buildPath,
|
||||
nodeEnv: env.raw.NODE_ENV,
|
||||
platform: env.raw.OAK_PLATFORM,
|
||||
|
|
|
|||
|
|
@ -16,8 +16,11 @@ function copyLocaleFiles() {
|
|||
const buildPath = Path.resolve(paths.appPublic, Locales);
|
||||
consola.success(`${chalk.greenBright('读取locales,生成json数据')}`);
|
||||
const json = buildLocales({
|
||||
projectPath: paths.appRootSrc,
|
||||
businessProjectPath: paths.oakGeneralBusinessAppPath,
|
||||
projectPaths: [
|
||||
paths.appRootSrc,
|
||||
paths.oakGeneralBusinessAppPath,
|
||||
paths.appSrc,
|
||||
],
|
||||
buildPath,
|
||||
nodeEnv: env.raw.NODE_ENV,
|
||||
platform: env.raw.OAK_PLATFORM,
|
||||
|
|
|
|||
Loading…
Reference in New Issue