I was reminded of glitch again today, and wondered if I could use vuejs with a project. The answer seems to be yes, but I don’t understand why. I see this example: https://glitch.com/edit/#!/vuejs-template , and it works for me, but I’m confused with the reference to server.js (in package.json) that appears to not exist, and that the .vue file is being processed at all. I would appreciate any help with what is actually going on under the hood.
you can always try to remix the example app and make changes, to figure out what’s going on anyway! In this particular case,
package.json specifies a
main field, but it is not used at all, so it can be removed. This solves the “server.js” mystery, right?
Everything else works in this way:
package.json specifies the dependencies of the application, and you see
pushstate-serverlisted. You can find in npm that pushstate-server is simply a webserver.
package.json specifies the
startscript, it’s the script that is run to start the application. You can see that it is set to
pushstate-server: so the application is a webserver!
When you click Show, the webapp is opened in a new tab of your browser, and since it is a webserver, it loads index.html, which references index.js, which loads app.vue
If something is still not clear, let us know!