0%

nx-config

Generate project with default styling file extension

Nx based monorepo can use file nx.json to config project generate options for specific frameworks.
Take the following config as an example, when creating angular applications, nx will use scss as file extension for style files by default. If you want the terminal prompt you during the generation, remove the style option from the config.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"generators": {
"@nx/react": {
"application": {
"style": "less",
"linter": "eslint",
"bundler": "vite",
"babel": true
},
"component": {
"style": "less"
},
"library": {
"style": "less",
"linter": "eslint"
}
},
"@nx/angular:application": {
"style": "scss", // <--- use scss as default style file
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nx/angular:library": {
"linter": "eslint",
"unitTestRunner": "jest"
},
"@nx/angular:component": {
"style": "scss" // <--- use scss as default style file
},
"@nx/web:application": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "none"
}
}