code: function add(elePath, args) {
    if (!args || !args.urlPath) return;
    const ele = parseElePath(elePath, 'component');
    const routePath = `src/features/${ele.feature}/route.js`;
    if (!vio.fileExists(routePath)) {
      throw new Error(`route.add failed: file not found ${routePath}`);
    }
  
    const { urlPath } = args;
    refactor.addImportFrom(routePath, './', '', ele.name);
  
    const ast1 = ast.getAst(routePath, true);
    const arrNode = getChildRoutesNode(ast1);
    if (arrNode) {
      const rule = `{ path: '${urlPath}', component: ${ele.name}${
        args.isIndex ? ', isIndex: true' : ''
      } }`;
      const changes = refactor.addToArrayByNode(arrNode, rule);
      const code = refactor.updateSourceCode(vio.getContent(routePath), changes);
      vio.save(routePath, code);
    } else {
      throw new Error(
        `You are adding a route rule, but can't find childRoutes property in '${routePath}', please check.`
      );
    }
  }
docs: Add component to a route.js under a feature. It imports all component from index.js