SPART4K63
@SPART4K63
front-end developer

Почему nuxt не может найти файлы?

Если я собираю свой проект через npm run dev - то все работает отлично, но при сборке npm run build происходит такая вещь.
60a21bd34b65c196087442.png
Он не может найти файлы, причем что хочет он их найти по такому адресу:
file:///D:/_nuxt/63412c4316ba0bce9ce5.js
А проводник в моем проекте выглядит так:
60a21c0de42e3909867887.png
Вот мой файл nuxt.config.js
export default {
  // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
  ssr: false,

  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'healthapp',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    { src: '~assets/scss/default.scss', lang: 'scss' },
    { src: '~/assets/fonts/lato/lato.css', lang: 'css' }
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
  '@nuxtjs/axios'
  ],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    splitChunks: {
      layouts: true
    },
    filenames: {
     app: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
     chunk: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
     css: ({ isDev }) => isDev ? '[name].css' : '[contenthash].css',
     img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[hash:7].[ext]',
     font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'fonts/[hash:7].[ext]',
     video: ({ isDev }) => isDev ? '[path][name].[ext]' : 'videos/[hash:7].[ext]'
   }
  }
}

Добавил в filenames по совету в интернете когда начал гуглить это ошибку, не помогло.
Что я сделал не так?
  • Вопрос задан
  • 290 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы