Z
Z
Zhalgas Saparov2019-09-09 10:33:44
webpack
Zhalgas Saparov, 2019-09-09 10:33:44

Why doesn't publicpath change in vue?

PublicPath doesn't work in vue.config.js.
I changed the connection path to /example/, but the output is /#/
Here is the code:
const path = require('path')

const path = require('path')

module.exports = {
  publicPath: process.env.NODE_ENV === 'production'
    ? '/example/'
    : '/',
  configureWebpack: {
    resolve: {
      alias: {
        'vue$': path.resolve('./node_modules/vue/dist/vue.common.js'),
      }
    }
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NapoleonIT, 2020-03-21
@NapoleonIT

so that there is no /#/, you need to write mode: history in your router. the publicPath variable is responsible for the application publishing address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question