You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This schematic will add [TailwindCSS](https://tailwindcss.com/) to your [Angular](https://angular.io) application.
4
4
@@ -8,107 +8,38 @@ This schematic will add [TailwindCSS](https://tailwindcss.com/) to your [Angular
8
8
ng add @nartc/tailwind-schematics
9
9
```
10
10
11
-
## Limitation
11
+
## Usage with Nx
12
12
13
-
-[AngularCLI](https://cli.angular.io)-powered projects only
14
-
- No prior **Custom Webpack** configuration setup with [@angular-builders/custom-webpack](https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack)
13
+
In Nx, you can either use `nx add` or `ng add` (same as above) to use the schematics.
15
14
16
-
## Schematic details
15
+
```
16
+
nx add @nartc/tailwind-schematics
17
+
```
17
18
18
-
###Options
19
+
## Options
19
20
|name|type|default|description|
20
21
|----|----|-------|-----------|
21
-
|configDirectory|string|.|The location where the config files (TailwindCSS and Webpack) will be stored|
22
-
|tailwindConfigFileName|string|tailwind.config|File name of TailwindCSS Config|
23
-
|usePurgeCss|boolean|true|Setup PurgeCSS in Production build|
24
22
|cssFlavor|string|css|The CSS flavor the project is using|
25
23
26
-
#### Note
27
-
Please add `./` when you provide a different value for `configDirectory`.
28
-
29
-
### Dependencies
30
-
31
-
The schematic will add the following packages to `devDependencies` and install:
32
-
-`@angular-builders/custom-webpack`
33
-
-`tailwindcss`
34
-
-`postcss-import`
35
-
-`postcss-loader`
36
-
-`@fullhuman/postcss-purgecss` if `usePurgeCss` is `true`
37
-
-`postcss-<cssFlavor>`: if `cssFlavor !== 'css'`, then a `postcss-<cssFlavor>` will be added as well
38
-
39
-
### Configuration Files
40
-
41
-
#### TailwindCSS Config
42
-
43
-
The schematic uses `tailwindConfigFileName` to generate a `<tailwindConfigFileName>.js` file as [TailwindCSS Configuration](https://tailwindcss.com/docs/configuration). The default content is as follows:
44
-
45
-
```js
46
-
module.exports= {
47
-
prefix:'',
48
-
separator:':',
49
-
theme: {}
50
-
}
51
-
```
52
-
53
-
#### Webpack Config
54
-
55
-
Webpack configuration is generated based on `usePurgeCss`
56
-
57
-
- With `PurgeCSS`
58
-
-`webpack-dev.config.js`: Development Webpack configuration file
59
-
-`webpack-prod.config.js`: Production Webpack configuration file with `purgecss` setup
60
-
- Without `PurgeCSS`
61
-
-`webpack.config.js`: A single Webpack configuration file to be used in both Development and Production environment
62
-
63
-
#### `angular.json`
64
-
65
-
The schematic will modify `angular.json` file to use `@angular-builders/custom-webpack` instead of the default `@angular-devkit/build-angular` with the proper `customWebpackConfig.path` based on the `configDirectory` and **Webpack Config** above. Before and after are as follows:
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
37
+
38
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
39
+
<!-- prettier-ignore-start -->
40
+
<!-- markdownlint-disable -->
41
+
<!-- markdownlint-restore -->
42
+
<!-- prettier-ignore-end -->
43
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
44
+
45
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
0 commit comments