This is the first time I have used a frontend Build Tool. In the past I have never used any type of a framework that was more complicated to install than just adding a <script>
tag to the top of my html page. Now you know my level of knowledge.
I have a vue.js/vuetify application with directory structure like this:
I think it started with the vuetify/webpack advanced template. And I am trying to export the project into something that I can put online. I have in my head that somehow I can run some type of a command that will generate all my code into .html, .css, and .js files that I could then hook up to any sort of backend that I wanted.
If my assumption is correct, and that's how things are done, then how is routing handled? Is the entire site just in one html file?
I think webpack is supposed to do this maybe? However when I try to run webpack
from the command line, I get command not found
.
If my assumption is wrong, then how do I get this online?
Use the
npm run build
command. You can see what the command does inside thepackage.json
file, scripts object.Your entire site will be compiled into the
index.html
file and thebuild.js
file located in the/dist
folder. Both the/dist
folder and thebuild.js
are generated when you run thenpm run build
command. Make sure the scriptsrc
inside ofindex.html
is pointing to yourbuild.js
file.