Skip to content

Commit

Permalink
feat(@schematics/angular): add sideEffects:false to library package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
fischeversenker authored and dgp1130 committed Oct 25, 2022
1 parent ca7ca1b commit 62121f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
},
"dependencies": {
"tslib": "^<%= tsLibLatestVersion %>"
}
}
},
"sideEffects": false
}
8 changes: 8 additions & 0 deletions packages/schematics/angular/library/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ describe('Library Schematic', () => {
expect(fileContent.peerDependencies['@angular/core']).toBe(`^${angularVersion}`);
});

it('should add sideEffects: false flag to package.json named "foo"', async () => {
const tree = await schematicRunner
.runSchematicAsync('library', defaultOptions, workspaceTree)
.toPromise();
const fileContent = getFileContent(tree, '/projects/foo/package.json');
expect(fileContent).toMatch(/"sideEffects": false/);
});

it('should create a README.md named "foo"', async () => {
const tree = await schematicRunner
.runSchematicAsync('library', defaultOptions, workspaceTree)
Expand Down

0 comments on commit 62121f8

Please sign in to comment.