This commit is contained in:
Wang Kejun 2022-05-31 19:11:11 +08:00
parent 49eb0a0a8b
commit fce0c4cec4
1 changed files with 6 additions and 5 deletions

View File

@ -18,12 +18,13 @@ const WRITE_DIR = SOURCE + '/i18n';
const DEFAULT_LOCALE = 'zh-CN';
const DEFAULT_FALLBACK_LOCALE = 'zh-CN';
const BASE_PATH = path.dirname(
require.resolve(
`${process.cwd()}/node_modules/oak-frontend-base/src/platforms/wechatMp/i18n/wxs/wxs.js`
)
);
function getWxsCode() {
const BASE_PATH = path.dirname(
require.resolve(
`${process.cwd()}/node_modules/oak-frontend-base/src/platforms/wechatMp/i18n/wxs/wxs.js`
)
);
const code = fs.readFileSync(path.join(BASE_PATH, '/wxs.js'), 'utf-8');
const runner = `module.exports = { \nt: Interpreter.getMessageInterpreter() \n}`;
return [code, runner].join('\n');