如何解决如何从 Nebular Auth 修复构建 sass 文件
如果您尝试只安装 Nebular Auth Module
,您可能会遇到以下错误。
Error: ./src/styles.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.
╷
5 │ ┌ @include nb-install() {
6 │ │ @include nb-theme-global();
7 │ │ @include nb-auth-global();
8 │ │ };
│ └─^
╵
src/styles.scss 5:1 root stylesheet
怎么办?
解决方法
解决方案是创建一个 src/themes.scss
文件,如下所示:
@import '~@nebular/theme/styles/theming';
@import '~@nebular/theme/styles/themes/default';
$nb-themes: nb-register-theme((),default,default);
并在 src/styles.scss
中添加此导入:
@import 'themes';
@import "~@nebular/theme/styles/globals";
@import '~@nebular/auth/styles/globals';
@include nb-install() {
@include nb-theme-global();
@include nb-auth-global();
};
确保您在 nebular theme css
中导入了 angular.json
:
"styles": [
"node_modules/@nebular/theme/styles/prebuilt/default.css","src/styles.scss"
],
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。