增加namespaces文件夹识别

This commit is contained in:
Wang Kejun 2023-09-05 17:13:00 +08:00
parent 5084f6da41
commit a0adb18bba
2 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ module.exports = (babel) => {
// this.props.t/this.t/t // this.props.t/this.t/t
// 处理策略为给第二个参数中加上'#oakNameSpace, #oakModule两个参数告知t模块此文件相应的位置再加以处理寻找 // 处理策略为给第二个参数中加上'#oakNameSpace, #oakModule两个参数告知t模块此文件相应的位置再加以处理寻找
if ( if (
/(pages|components)[\w|\W]+(.tsx|.ts|.jsx|.js)$/.test(res) /(pages|components|namespaces)[\w|\W]+(.tsx|.ts|.jsx|.js)$/.test(res)
) { ) {
const { node } = path; const { node } = path;
if ( if (

View File

@ -12,7 +12,7 @@ function isOakNamespaceIdentifier(node, name) {
} }
const Regex = const Regex =
/([\\/]*[a-zA-Z0-9_-\w\W]|[\\/]*[a-zA-Z0-9_-\w\W]:)*[\\/](lib|src|es)[\\/](pages|components)+[\\/]/; /([\\/]*[a-zA-Z0-9_-\w\W]|[\\/]*[a-zA-Z0-9_-\w\W]:)*[\\/](lib|src|es)[\\/](pages|components|namespaces)+[\\/]/;
module.exports = (babel) => { module.exports = (babel) => {
return { return {