S
S
skuvaWeb2018-12-24 02:28:50
JavaScript
skuvaWeb, 2018-12-24 02:28:50

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.
5c2019c145d7e239257196.png
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

2 answer(s)
S
skuvaWeb, 2018-12-24
@skuvaWeb

Inattentively read the documentation, the problem is described here

N
nsk_54, 2019-11-04
@nsk_54

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 question

Ask a Question

731 491 924 answers to any question