Search code examples
javascriptvue.jsvuejs2vue-cli-3

Standalone VUE application


Is possible to build vuejs as a standalone app? So I am not depended on my web hotel backend services.

Basically I just don't want to start up the app through npm, but by simply open index.html from the dist folder over file:// protocol.

My webhotel doesn't support npm and node.js.


Solution

  • If you run npm run build it will generate the dist directory with needed js and css files and index.html if you open this file in your browser without HTTP server you will have errors in browsers console like :

    Failed to load resource: net::ERR_FILE_NOT_FOUND app.f5g4fd.js

    to fix this open index.html in text editor and remove \ at the beginning from src or href script and link tags like :

      <script src=/js/app.c6a4cab1.js></script>
    

    should be :

      <script src=js/app.c6a4cab1.js></script>
    

    save the file and open it over file://