3

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.

4
  • please provide more details ? Dec 5, 2018 at 19:38
  • I want to be able to just open index.html. I don't want to start with npm run serve
    – Dasma
    Dec 5, 2018 at 19:41
  • So you only have the local files and don't want to have it on a server o something like that? You want to have it similar to an Electron App?
    – IvanS95
    Dec 5, 2018 at 19:43
  • Maybe this help? Tip: built files are meant to be served over an HTTP server. Opening index.html over file:// won't work. I want Opening index.html over file://
    – Dasma
    Dec 5, 2018 at 19:48

1 Answer 1

4

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://

2
  • Doesn't the app loss features?
    – Dasma
    Dec 5, 2018 at 20:01
  • 1
    no i usually use this way, i copy the dist directory and name it docs and i do the changes cited above and i deploy it to github pages, features like axios calls will be saved repo and index.html Dec 5, 2018 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.