如何解决 ng 构建期间缺少 css 文件的问题?

nav*_*tor 0 fullcalendar angular

我最近将 Angular 版本从 8 升级到 10。在修复了出现的所有问题并安装了所有组件的更新版本后,我在ng build.

ERROR in ./src/styles.css (./node_modules/css-loader/dist/cjs.js??ref--12-1!./node_modules/postcss-loader/src??embedded!./src/styles.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Failed to find '@fullcalendar/core/main.css'
  in [
    D:\Source\Repos\Vims\VIMS\VIMS-App\src
  ]
    at D:\Source\Repos\Vims\VIMS\VIMS-App\node_modules\postcss-import\lib\resolve-id.js:35:13
    at async Promise.all (index 0)
Run Code Online (Sandbox Code Playgroud)

我尝试过更新软件包、卸载并重新安装 @fullcalendar/core 以及ng prune,但错误不会消失。我仍然缺少文件夹中的 main.css。

有人可以帮忙吗?

fre*_*hbm 7

如 fullcalendar 更新说明中所述,您应该删除 style.css 中对 fullcalendar *.css 文件的引用,因为更新版本不再需要它们。每个插件都会照顾它自己的样式。

\n
\n

在 v4 中,您有责任导入所有 fullcalendar\xe2\x80\x99s\nstylesheets。您可能已在您的项目\xe2\x80\x99s SASS 文件中完成了此操作。\n或者,如果您有一个处理 CSS 的构建系统,则\n您可能已通过 JavaScript 完成了此操作。

\n

在 v5 中,您不再需要这样做!插件将导入它们自己的样式表(引导插件除外)。

\n
\n

https://fullcalendar.io/docs/upgrading-from-v4

\n