DevCloudFE / ng-devui

Angular UI Component Library based on DevUI Design
https://devui.design
MIT License
1.75k stars 210 forks source link

🐛 [Bug]: Can't resolve '~ng-devui/devui-layout.css' #298

Closed bmbper closed 1 year ago

bmbper commented 1 year ago

Version

14.1.0

Angular Version

15.0.3

Link to minimal reproduction

style.scss文件中

@import "~ng-devui/devui-layout.css";

Step to reproduce

style.scss文件中

@import "~ng-devui/devui-layout.css";

What is expected

<d-row [dGutter]="24"> <d-col [dSpan]="24">Primary <d-col [dSpan]="24"><d-button [disabled]="true">Disabled

生效

What is actually happening

./src/styles.scss - Error: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Can't resolve '~ng-devui/devui-layout.css' in '/Users/zgk/Code/10prod/bmb/bmbp_admin/ng-admin/src'

./src/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  ╷
3 │ @import "ng-devui/";
  │         ^^^^^^^^^^^
  ╵
  src/styles.scss 3:9  root stylesheet

Any additional comments (optional)

No response

bmbper commented 1 year ago

通过angular.json引入

 "styles": [
              "src/styles.scss",
              "node_modules/ng-devui/devui.min.css",
              "node_modules/ng-devui/devui-layout.min.css"

            ],