Issue with Image Loading:
While the demo successfully loads all resources and uploads images correctly, there is an issue where an extra /dist/
is being requested for image paths, resulting in a 404 error.
Demo Link:
https://i.sstatic.net/XjniG.png
Configuration of the Demo:
vue.config.js:
module.exports = {
publicPath: process.env.NODE_ENV === "production" ? "/dist/" : "/",
lintOnSave: false,
devServer: {
proxy: {
"/demo": {
target: "http://xx.xx.xxx.xxx",
ws: true,
changeOrigin: true
}
}
}
};
router.js
export default new Router({
mode: 'hash',
base: "/dist/",
routes: [...]
})
The intention is to place the dist
folder in the server directory.
The goal is to eliminate the need for the /dist/ path and ensure that images load correctly.
During deployment, Vue-CLi
automatically adds the /dist/ to image paths. While it works fine locally, the deployment on the server is appending more /dist/
.
It seems like there was an error during server deployment. How can I rectify this?
Any assistance would be greatly appreciated!