Сборка Nuxt run не удалась, но dev в порядке (загрузчик для обработки этого типа файлов) - PullRequest
0 голосов
/ 26 апреля 2019

Я использую nuxt.js с Vue

У меня проблема с запуском проекта в режиме сборки (npm run build). В режиме разработки проект запускается (npm run dev -> 0 ошибок и localhost: 3000 работает)

Я пытался удалить папку .nuxt, узлы-модули и файл блокировки, попробовать пряжу и npm, я пробовал разные варианты - один результат

Когда я пытаюсь выполнить "npm run build", у меня появляется 41 ошибка с ./node_modules/bootstrap-vue/src/

    ERROR  Failed to compile with 41 errors                                                                        22:48:24

    error  in ./node_modules/bootstrap-vue/src/components/layout/col.js

    Module parse failed: Unexpected token (100:4)
    You may need an appropriate loader to handle this file type.
    |     cols: strNum(),
    |     // Breakpoint Specific props
    |     ...breakpointCol,
    |     offset: strNum(),
    |     ...breakpointOffset,

    @ ./node_modules/bootstrap-vue/src/components/layout/index.js 3:0-24
    @ ./node_modules/bootstrap-vue/src/components/index.js
    @ ./node_modules/bootstrap-vue/src/index.js
    @ ./.nuxt/bootstrap-vue.js
    @ ./.nuxt/index.js
    @ ./.nuxt/client.js

    error  in ./node_modules/bootstrap-vue/src/components/toast/helpers/bv-toast.js

    Module parse failed: Unexpected token (107:6)
    You may need an appropriate loader to handle this file type.
    |     // Preset the prop values
    |     propsData: {
    |       ...filterOptions(getComponentConfig('BToast') || {}),
    |       // Add in (filtered) user supplied props
    |       ...omit(props, ['toastContent']),

    @ ./node_modules/bootstrap-vue/src/components/toast/index.js 3:0-47
    @ ./node_modules/bootstrap-vue/src/components/index.js
    @ ./node_modules/bootstrap-vue/src/index.js
    @ ./.nuxt/bootstrap-vue.js
    @ ./.nuxt/index.js
    @ ./.nuxt/client.js

my nuxt.config.js

module.exports = {
  mode: "spa",
  head: {
    title: "nuxt-template",
    meta: [ { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      { hid: "description", name: "description", content: "Nuxt.js project" } ],
    link: [ { rel: "icon", type: "image/x-icon", href: "/favicon.ico" } ],
    script: [ { src: "/js/signalr.js" } ]
  },
  css: ["~assets/scss/coreui.scss"],
  loading: {
    color: "#3B8070"
  },
  plugins: ["~/plugins/bootstrap-vue", "~/plugins/vue-notifications", "~/plugins/mixin", "~/plugins/vue-tables-2", "~/plugins/moment.js", "~/plugins/vue-text-mask.js", "~/plugins/vue-clipboard2.js"],
  build: {
    analyze: true,
    vendor: ["axios", "bootstrap-vue", "vue-notifications", "mini-toastr", "js-cookie", "jwt-decode", "vuelidate", "vue-tables-2", "moment", "vue-text-mask", "vue-select", "vue-clipboard2", "vue-qrcode-component"],
    extend(config, { isDev, isClient }) {
      if (isClient) {
        config.devtool = "eval-source-map";
      }
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: "pre",
          test: /\.(js|vue)$/,
          loader: "eslint-loader",
          exclude: /(node_modules)/
        });
      }
    }
  },
  modules: [ [ "bootstrap-vue/nuxt", { css: false } ] ]
};

Какой обработчик запрашивает этот тип файла? Как добавить соответствующий загрузчик для обработки файлов этого типа?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...