File tree 2 files changed +5
-3
lines changed
packages/schematics/angular/application
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,9 @@ export default function (options: ApplicationOptions): Rule {
399
399
} ) ,
400
400
mergeWith (
401
401
apply ( url ( './other-files' ) , [
402
+ options . strict
403
+ ? noop ( )
404
+ : filter ( path => path !== '/package.json.template' ) ,
402
405
componentOptions . inlineTemplate
403
406
? filter ( path => ! path . endsWith ( '.html.template' ) )
404
407
: noop ( ) ,
Original file line number Diff line number Diff line change @@ -310,13 +310,12 @@ describe('Application Schematic', () => {
310
310
expect ( content . sideEffects ) . toBe ( false ) ;
311
311
} ) ;
312
312
313
- it ( 'sideEffects property should be false when not in strict mode' , async ( ) => {
313
+ it ( 'sideEffects package.json should not exist when not in strict mode' , async ( ) => {
314
314
const options = { ...defaultOptions , projectRoot : '' , strict : false } ;
315
315
316
316
const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
317
317
. toPromise ( ) ;
318
- const content = JSON . parse ( tree . readContent ( '/src/app/package.json' ) ) ;
319
- expect ( content . sideEffects ) . toBe ( true ) ;
318
+ expect ( tree . exists ( '/src/app/package.json' ) ) . toBeFalse ( ) ;
320
319
} ) ;
321
320
322
321
describe ( 'custom projectRoot' , ( ) => {
You can’t perform that action at this time.
0 commit comments