Answer the question
In order to leave comments, you need to log in
Vue Cli wrong paths in build build?
I am learning vue.js and I have a problem. When you run npm run build, it generates a folder, but js, css, and pictures are incorrectly connected to html. Webpack for some reason puts a '/' character at the beginning of the path.
However, if this symbol is removed, then everything starts working. How to make webpack stop generating this character at the beginning of the path?
The project was built on vue cli 3, so there were no rules in the webpack config
Answer the question
In order to leave comments, you need to log in
If it's still relevant .... I myself encountered the same problem. Several days of dancing with a tambourine gave the result.
in the file node_modules / @vue / cli-service / lib / option.js
in export default change the path from '/' to './'
exports.defaults = () => ({
// project deployment base
publicPath: './ '
........
ONLY BEFORE BUILDING THE PROJECT
!!!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question