vue-cli package after the project path error problem

I. Description of the problem

After executing the command npm run build, package generated dist folder, access time reported the following error:

Second, the solution

In the root directory, create vue.config.js file, as follows,

module.exports = {
    publicPath:'./',
    configureWebpack:{
        resolve: {
            alias: {
              'assets': '@/assets',
              'common': '@/common',
              'components': '@/components',
              'network': '@/network',
              'views': '@/views',
              'plugins': '@/plugins',
            }
          }
    }
}

Packing again, smooth access:

 

Guess you like

Origin www.cnblogs.com/xulinjun/p/12499590.html