编译path 加上对js文件匹配

This commit is contained in:
Wang Kejun 2022-09-13 14:32:52 +08:00
parent dbe74a02a3
commit c3a0790729
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ module.exports = (babel) => {
const rel = relative(cwd, filename).replace(/\\/g, '/');
const { node, parent } = path;
if (node.name === 'OakPage' && /pages[\w|\W]+index\.ts$/.test(rel)) {
if (node.name === 'OakPage' && /pages[\w|\W]+index\.(ts|js)$/.test(rel)) {
console.log(rel);
const relativePath = rel.slice(9, rel.length - 9);
console.log(relativePath);