File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
packages/schematics/angular/application Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,14 @@ function addDependenciesToPackageJson(options: ApplicationOptions) {
157
157
} ) ;
158
158
}
159
159
160
+ if ( options . style === Style . Less ) {
161
+ addPackageJsonDependency ( host , {
162
+ type : NodeDependencyType . Dev ,
163
+ name : 'less' ,
164
+ version : latestVersions [ 'less' ] ,
165
+ } ) ;
166
+ }
167
+
160
168
if ( ! options . skipInstall ) {
161
169
context . addTask ( new NodePackageInstallTask ( ) ) ;
162
170
}
Original file line number Diff line number Diff line change @@ -282,6 +282,20 @@ describe('Application Schematic', () => {
282
282
expect ( pkg . dependencies [ 'zone.js' ] ) . toEqual ( latestVersions [ 'zone.js' ] ) ;
283
283
} ) ;
284
284
285
+ it ( 'should add "less" to devDependencies when Less is selected as the style option' , async ( ) => {
286
+ const tree = await schematicRunner . runSchematic (
287
+ 'application' ,
288
+ {
289
+ ...defaultOptions ,
290
+ style : Style . Less ,
291
+ } ,
292
+ workspaceTree ,
293
+ ) ;
294
+
295
+ const pkg = JSON . parse ( tree . readContent ( '/package.json' ) ) ;
296
+ expect ( pkg . devDependencies [ 'less' ] ) . toEqual ( latestVersions [ 'less' ] ) ;
297
+ } ) ;
298
+
285
299
it ( 'should include zone.js if "zoneless" option is not present' , async ( ) => {
286
300
const tree = await schematicRunner . runSchematic (
287
301
'application' ,
You can’t perform that action at this time.
0 commit comments