如何解决Nuxt.js上的部署问题
情况如下:
Nuxt.js(模式:通用)。
http://webmaster.ayrveda.ru/dist/
在开发模式下,项目运行正常,没有问题。
部署时,我将路径编写如下:
路由器:{
基数:'/ dist /'
},
托管时看起来像这样:
部署后,页面(在主机上)将正常加载(如果您单击链接)-但是一旦我重新启动,404崩溃
例如+
,收藏夹图标无法加载-也就是说,此处的路径不符合我的理解-但不知道为什么。
问题:
我可以在不更改服务器端设置(Nginx等)的情况下解决此问题吗?
P.S。我的nuxt.config.js
看起来像这样:
const pkg = require('./package');
module.exports = {
mode: 'universal',/*
** Headers of the page
*/
head: {
title: pkg.name,meta: [
{ charset: 'utf-8' },{ name: 'viewport',content: 'width=device-width,initial-scale=1' },{ hid: 'description',name: 'description',content: pkg.description }
],script: [
{ src: 'https://seo-gmbh.eu/ss/js/jquery.min.js' },{ src: 'https://seo-gmbh.eu/ss/js/header.js' },],link: [
{ rel: 'icon',type: 'image/x-icon',href: '/favicon.ico' }
]
},/*
** Customize the progress-bar color
*/
loading: false,/*
** Global CSS
*/
css: [
],/*
** Plugins to load before mounting the App
*/
plugins: [{ src: '~plugins/vuex-shared-mutations.js',ssr: false }],/*
** Nuxt.js modules
*/
modules: [
// Doc: https://github.com/nuxt-community/axios-module#usage
'@nuxtjs/axios','nuxt-vuex-localstorage',/*
** Axios module configuration
*/
axios: {
// See https://github.com/nuxt-community/axios-module#options
},/*
** Routing configuration
*/
router: {
middleware: 'get_view_data',base: '/dist/'
},/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config,ctx) {
}
}
};
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。