Can't get rid of vue-router

  • Hi,

    quasar - 1.0.0-beta.4 / @quasar/app - 1.0.0-beta.8

    My application doesn’t use the vue-router, it is not referenced in any file, still I can’t remove the directory “router”.
    (node:19916) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open ‘D:\Documents…\src\router\index.js’.
    Is it a necessary evil or I miss something?

    Thanks in advance

  • Hmm. You don’t have any routes whatsoever? Vue is sort of a webframework, and webframeworks use things like URLs and webviews to collate information and display them to the user.

  • @elias-p said in Can't get rid of vue-router:

    Is it a necessary evil or I miss something?

    It’s no evil at all. Even if you don’t use router (that is you use only one route for the whole app) I don’t think it will affect anything (app speed, production package size etc.) So just don’t delete the router directory.

  • Simple apps may want to migrate, a simple router doesn’t ‘need’ the whole router folder and multiple routes but the toolchain seems to be hard coded (I’ll keep the opinions to myself). However, as a workaround, create/keep the /router folder with index.js/ts inside and inside that file…

    import router from ‘…/router.js’ // or whereever you want to put it…
    export default router;

    Done, hard coded path averted.

Log in to reply