我正在做一个包含多个文件和文件夹的大项目。现在,当我运行 npm run dev
Nuxt显示的是这些恼人的警告。
WARN Compiled with 7 warnings friendly-errors 11:11:49
WARN Error friendly-errors 11:11:49
chunk pages/add-new-property/index.pages/property/index.pages/room-management/add-new/index.pages/signup/index [extract-css-chunks-webpack-plugin]
Conflicting order. Following module has been added:
* css ./node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--7-oneOf-1-3!./node_modules/vuetify-loader/lib/loader.js??ref--16-0!./node_modules/vue-loader/lib??vue-loader-options!./components/property/policies/yes-no-box.vue?vue&type=style&index=0&id=67558805&lang=scss&scoped=true&
despite it was not able to fulfill desired ordering with these modules:
* css ./node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--7-oneOf-1-3!./node_modules/vuetify-loader/lib/loader.js??ref--16-0!./node_modules/vue-loader/lib??vue-loader-options!./components/UI/checkbox/checkbox.vue?vue&type=style&index=0&lang=scss&
- couldn't fulfill desired order of chunk group(s) pages/property/index, pages/room-management/add-new/index
- while fulfilling desired order of chunk group(s) pages/add-new-property/index, pages/signup/index
. . .
这只是7个警告中的一个。
谁能告诉我如何修复或者至少在Nuxtjs中忽略这些警告?请注意,这些警告来自 extract-css-chunks-webpack-plugin----------。 非来自 mini-css-extract-plugin.
pagespropertyindex,pagesroom-managementadd-newindex和pagesadd-new-propertyindex,pagessignupindex。
它们都导入了一些组件,但导入的顺序不同。所以你必须检查这些文件的导入顺序。
例如,文件a.vue和b.vue的导入顺序不同。
a. vue:
import CompA from 'xxx'
import CompB from 'yyy'
b. vue
import CompB from 'yyy'
import CompA from 'xxx'
这将导致错误。