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) {
157157 } ) ;
158158 }
159159
160+ if ( options . style === Style . Less ) {
161+ addPackageJsonDependency ( host , {
162+ type : NodeDependencyType . Dev ,
163+ name : 'less' ,
164+ version : latestVersions [ 'less' ] ,
165+ } ) ;
166+ }
167+
160168 if ( ! options . skipInstall ) {
161169 context . addTask ( new NodePackageInstallTask ( ) ) ;
162170 }
Original file line number Diff line number Diff line change @@ -282,6 +282,20 @@ describe('Application Schematic', () => {
282282 expect ( pkg . dependencies [ 'zone.js' ] ) . toEqual ( latestVersions [ 'zone.js' ] ) ;
283283 } ) ;
284284
285+ it ( 'should include "less" as a dev dependency if style is less' , 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+
285299 it ( 'should include zone.js if "zoneless" option is not present' , async ( ) => {
286300 const tree = await schematicRunner . runSchematic (
287301 'application' ,
You can’t perform that action at this time.
0 commit comments