【问题标题】:Angular Material 11.0.3 + Tailwind CSS not workingAngular Material 11.0.3 + Tailwind CSS 不工作
【发布时间】:2021-04-14 13:47:49
【问题描述】:

我在 NodeJS 14.15.4 上使用 Angular CLI 11.0.6 来制作一个用于学习 Angular(11.0.7) 和 TailwindCSS 2.0.2 的 Web 应用程序。我按照本教程安装 Tailwind,但在此之前我添加了 Angular Material。但是添加材料后,我似乎无法运行代码。尝试执行 ng s 会出错

Your project is not using the default builders for "build". The Angular Material schematics cannot add a theme to the workspace configuration if the builder has been changed.

我相信这是因为教程让我更改了 angular.json 文件

"architect": {
  "build": {
-   "builder": "@angular-devkit/build-angular:browser",
+   "builder": "ngx-build-plus:browser",                   
    "options": {
+     "extraWebpackConfig": "webpack.config.js",
      ...
    }
    ...
  },
  "serve": {
-   "builder": "@angular-devkit/build-angular:dev-server",
+   "builder": "ngx-build-plus:dev-server",
    "options": {
+     "extraWebpackConfig": "webpack.config.js",
      ...
    }
    ...
  },
  "test": {
-   "builder": "@angular-devkit/build-angular:karma",
+   "builder": "ngx-build-plus:karma",
    "options": {
+     "extraWebpackConfig": "webpack.config.js",
      ...
    }
    ...
  },

因此添加了以 + 开头的行并删除了 -。如果可以的话,请帮助我,因为我正在学习 Angular,以便在这些困难时期找到一份工作。非常感谢您提供帮助或阅读本文。

【问题讨论】:

标签: angular typescript webpack angular-material tailwind-css


【解决方案1】:

使用 ng add 添加 Angular 材质,现在一切正常。感谢 Linh。

【讨论】:

    猜你喜欢
    • 2022-12-20
    • 2021-10-22
    • 2018-07-22
    • 2020-12-01
    • 2020-04-04
    • 1970-01-01
    • 1970-01-01
    • 2020-08-09
    • 2023-01-13
    相关资源
    最近更新 更多