index.js文件中req.keys().forEach()中,mod如果是./组件名称/style/index.tsx,那下面这个正则匹配的结果是null,但是看代码它应该是想匹配组件名称然后导出吧,这个是正则写法的问题吗?
const match = mod.match(/^\.\/([^_][\w-]+)\/index\.tsx?$/);
console.log(match) //null
if (match && match[1]) {
if (match[1] === 'message' || match[1] === 'notification') {
// message & notification should not be capitalized
exports[match[1]] = v;
} else {
exports[camelCase(match[1])] = v;
}
}