When I copy my build dist folder on my serve, the website is http://my_site/project/
But when I click to change page (ex : inventory) the URL become http://my_site/inventory
I need a URL like http://my_site/project/inventory without hardcode it in my code.
I use Vue JS, vue-router and vite JS (vite-config file).
Thanks for your help
Related
Gridsome changes the uppercase path of /Clients to the lowercase path /clients when its built.
This means that setting a router path will not work as the path is case sensitive:
this.$router.push('/Clients')
How can I avoid this? Is it webpack? Does Gridsome want to avoid using router paths?
Further Example:
Pages in development -
Will build to a folder in the /dist directory:
Because the path is static and is not updated on the build, the path now does not work.
Any suggestions on how to avoid this or how to keep the path the same would be great.
I finally finish my project and ready to deploy. I generate my html files with yarn generate then point my nginx config to the /dist file. But when I visit the site, it looks like the JS is not getting loaded. Is there a config that I'm missing?
Console.log shows about 6 of this. (I think that's the number of my components that is not being loaded)
SyntaxError: expected expression, got '<'
btw, only my footer and navbar component is visible on the page, probably because there's no js to it.
I'm using vue cli 3, Vuetify. My back-end programmer asked me that put my css, js, and img file in static folder for him. How can I do? I cannot find webpack.config.js file at vue cli 3. some guys said use vue.config.js file, but I still don't know how to solve this problem.
thank you.
this link is build result. I want to put css, img, js files in one static folder.
Take a look at Public Folder for Vue CLI 3. To quote the docs
Any static assets placed in the public folder will simply be copied and not go through webpack. You need to reference them using absolute paths.
All you would need to do is place your css, js, images in your public folder
I have a project where I have placed the external js files like jquery, datepicker etc in the 'static' folder. I am importing them in the index.html file.
It is getting picked correctly when the page is directly loaded. But when navigating to the page using $this.router.push('/dashboard') the javascript does not get picked up.
Not sure if I am missing something here
I don't know how this vuejs project render data to the web browser. Can anyone help me to explain this?
Link url: https://github.com/huytrongnguyen/vue-cms
Notice: you have to clone this project to your computer.
Vue loader in the webpack config will change all of the components into Javascript. That JS is loaded when the index.html in the dist folder is opened in a browser. After the javascript is parsed, it'll run and populate the DOM with HTML strings created by the webpack process