Answer the question
In order to leave comments, you need to log in
How to set paths for files by type publicPath?
There is an application that is not deployed in the root of the domain and has the following setting in vue.confi.js
:
publicPath: process.env.NODE_ENV === 'production'
? '/subpath/'
: '/'
public
taking into account '/subpath/' where the application is deployed?
Answer the question
In order to leave comments, you need to log in
I solved this problem as follows:
Since Webpack, under the hood of vue-cli, does not process the data in the public folder in any way, but simply copies them , I had to explicitly access the publicPath variable from the script:
`${process.env.BASE_URL}path/you/need/file/png`
Hello
outputDir: '../static/dist',
publicPath: process.env.NODE_ENV === 'production'
? '/static/dist/'
: '/',
indexPath: process.env.NODE_ENV === 'production'
? '../../templates/index.html'
: 'index.html',
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question