W
W
WebDev2017-07-18 17:02:26
webpack
WebDev, 2017-07-18 17:02:26

Webpack and relative paths?

I am building a vue js project using webpack. After assembly, I get the index.html file and the static folder. So the script files in this index.html are absolutely included, that is, /static/script1 instead of static/script1.
As a result, after the Build, I have to manually change the paths, because the application does not start from the root.
Is it possible to configure paths to be relative and why are absolute paths used at all?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Reistline, 2018-06-21
@Reistline

It is necessary to write
module.exports = {
baseUrl: "."
};

P
pkring, 2019-10-25
@pkring

Create vue.config.js file in package.json directory and write in it

module.exports = {
  publicPath: './'
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question