Repository navigation
Commit 18e5dc6
fix(@schematics/angular): ignore non-workspace stylesheet entries when adding Tailwind
The tailwind schematic selects the first `styles` entry ending in `.css` and
appends the Tailwind import to it without checking that the entry is a file in
the workspace. When the first `.css` entry is a package specifier such as
`@angular/material/prebuilt-themes/azure-blue.css`, `ng add tailwindcss` fails
with a file-does-not-exist exception, and when it is a path within
`node_modules`, the vendor stylesheet is modified instead of a project file.
Only consider entries that exist in the workspace and are not within
`node_modules`, falling back to creating a dedicated `tailwind.css` otherwise.
New specs reproduce both failures without this change.
(cherry picked from commit a68d0df)1 parent eaf2343 commit 18e5dc6
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
132 | 168 | | |
0 commit comments