编译path 加上对js文件匹配
This commit is contained in:
parent
dbe74a02a3
commit
c3a0790729
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue