首页 > 解决方案 > Nuxt 构建的结果是中断

问题描述

我已经尝试使用 Nuxt generate 构建 Nuxt 并且 Nuxt 构建那些没有正确构建的,当我在 dev 中使用时,它看起来像是中断,它工作得很好,但是在我构建并运行它之后,第 3 方组件和 css 根本不起作用,这是因为我的nuxt.conf.js错吗??我以前问过这个,但还没有解决,

这是我的nuxt.config.js

export default {
  mode: 'universal',
  head: {
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      {
        hid: 'description',
        name: 'description',
        content: process.env.npm_package_description || ''
      }
    ],
    script: [
      {
        src: 'https://kit.fontawesome.com/d0ddd22222fa871ae5.js',
        crossorigin: 'anonymous'
      }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      {
        rel: 'stylesheet',
        href:
          'https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700&display=swap'
      },
      {
        rel: 'stylesheet',
        href: 'https://fonts.googleapis.com/css?family=Quando&display=swap'
      },
      {
        rel: 'stylesheet',
        href: 'https://fonts.googleapis.com/css?family=Palanquin&display=swap'
      }
    ]
  },
  /*
   ** Customize the progress-bar color
   */
  loading: { color: '#fff' },

  /*
   ** Global CSS
   */
  css: [
    '@/assets/css/main.css',
    '@/assets/css/input.css',
    '@/assets/css/animate.css'
  ],
  plugins: [
    { src: '@/plugins/agile.js', mode: 'client' },
    { src: '@/plugins/model-gltf.js', mode: 'client'},
  ],

  router: {
    middleware: ['router'],
  },
  buildModules: [
  ],

  modules: [
    'bootstrap-vue/nuxt',
    '@nuxtjs/axios'
  ],
  axios: {
    baseURL: "http://myapi"
  },

  build: {
    vendor: ['vue-agile', 'vue-3d-model'],
    extend(config, ctx) {
    }
  }
}

有人可以在这里节省我的时间吗

标签: vue.jsnuxt.js

解决方案


推荐阅读