Get all application routes from the console

I’m working on Vue CLI based project. I’d like to create a CLI task that would dump all routes in my application (something similar as rails routes does for those familiar with Rails).

I’ve created a basic node script with babel-node:

  ignore: [
  presets: [

const moduleAlias = require('module-alias');
moduleAlias.addAlias('@', __dirname + '/src');

const routes = require('./src/router/routes.js');


But encounter a problem with component imports inside the routes.js file. Those components are SFC and babel does not know how to handle such import (i.e. import Customer from '@/app/pages/Customer';) - it complains that < (from <script>) is not a valid JS syntax.

Is there a way to process those imports so I can get the object with routes? Or maybe there is another way to do it?