M
M
mrSeller2021-10-19 12:54:25
Vue.js
mrSeller, 2021-10-19 12:54:25

How to force vue-cli to use relative paths for js and css during build?

In the project, it is necessary to make sure that links to js and css are not generated absolutely: , but relatively: . This is a platform requirement that cannot be influenced in any way. I studied the documentation, but did not find such information anywhere. How to do it? src="/js/chunk-vendors.d8b43962.js"src="./js/chunk-vendors.d8b43962.js"


Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mrSeller, 2021-10-19
@mrSeller

Stumbled at random into vue.config.js Not a very obvious thing. But it works.
publicPath: './'

A
Anna Kolchina, 2021-10-19
@hacborn

It helped me to register in package.json
homepage: './'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question