X
X
xenofobius2018-12-16 15:11:28
Vue.js
xenofobius, 2018-12-16 15:11:28

How to make build with correct urls in vue-cli3?

After building the project, I would like to see static files in /static/dist/, for this I use baseUrl: "/static/dist/', in this case, when I go to the main page instead of the address 'localhost/' I get 'localhost/static/dist/ ' and all paths are built accordingly relative to this.my vue.config.js file

module.exports = {
  baseUrl: '/static/dist/',
  outputDir: '../api/static/dist/',
}

Tried to do build with config file config/index.js
build: { 
    assetsPublicPath: '/', 
    assetsSubDirectory: 'static',
  },

But when building, the view does not see this config file. How can I set up relative paths for static while using routing relative to '/' and not what is written in baseUrl?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Klein Maximus, 2019-01-11
@kleinmaximus

https://cli.vuejs.org/ru/config/#vue-config-js - everything is there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question