Nuxt.js module to use custom router instead of pages/ directory.

Usage no npm install needed!

<script type="module">
  import vapsterNuxtRouterModule from 'https://cdn.skypack.dev/@vapster/nuxt-router-module';


Nuxt Router Module

Nuxt module to use router.js instead of pages/ directory.


  1. Install @vapster/nuxt-router-module dependency with yarn or npm
  2. Add @vapster/nuxt-router-module to modules section of nuxt.config.js:
  modules: [
    // without options
    // with options
        path: 'router',
        filename: 'index.js',
        templateName: 'router.js',
  1. If you are using SPA mode, add an index / route to generate section of nuxt.config.js:
  generate: {
    routes: [


MIT License

Copyright (c) 2018 Vova Revenko vova@revenko.org