Skip to content

Commit 6d4f8a2

Browse files
clydinmgechev
authored andcommitted
test: remove material-design-icons package as a development dependency (#15096)
The package is quite large at 33MB (46MB on disk). The package is also only used in one test that is already covered by an E2E test. The E2E test does not require the package to be present for development as the test installs it within a generated project during execution. This also has the benefit of testing the icons package in a more real world use case; as well as allowing the test to serve as a guide for a user to add the package to their own application.
1 parent 0551360 commit 6d4f8a2

File tree

4 files changed

+24
-40
lines changed

4 files changed

+24
-40
lines changed

packages/angular_devkit/build_angular/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"karma-coverage-istanbul-reporter": "~2.0.0",
8181
"karma-jasmine": "~2.0.1",
8282
"karma-jasmine-html-reporter": "^1.4.0",
83-
"material-design-icons": "^3.0.1",
8483
"popper.js": "^1.14.1",
8584
"protractor": "~5.4.0",
8685
"zone.js": "^0.9.1"

packages/angular_devkit/build_angular/test/browser/styles_spec_large.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,6 @@ describe('Browser Builder styles', () => {
203203
});
204204
});
205205

206-
it(`supports material icons`, async () => {
207-
const overrides = {
208-
extractCss: true,
209-
optimization: true,
210-
styles: [
211-
{ input: '../../../../node_modules/material-design-icons/iconfont/material-icons.css' },
212-
],
213-
};
214-
215-
await browserBuild(architect, host, target, overrides);
216-
});
217-
218206
extensionsWithVariableSupport.forEach(ext => {
219207
it(`supports ${ext} includePaths`, async () => {
220208
let variableAssignment = '';
Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
import {silentNpm, ng} from '../../utils/process';
2-
import {updateJsonFile} from '../../utils/project';
3-
import {expectFileToMatch} from '../../utils/fs';
1+
import { expectFileToMatch } from '../../utils/fs';
2+
import { ng, silentNpm } from '../../utils/process';
3+
import { updateJsonFile } from '../../utils/project';
44

5+
export default async function() {
6+
// Install material design icons
7+
await silentNpm('install', 'material-design-icons@3.0.1');
58

6-
export default function() {
7-
// TODO(architect): Delete this test. It is now in devkit/build-angular.
9+
// Add icon stylesheet to application
10+
await updateJsonFile('angular.json', workspaceJson => {
11+
const appArchitect = workspaceJson.projects['test-project'].architect;
12+
appArchitect.build.options.styles = [
13+
{ input: 'node_modules/material-design-icons/iconfont/material-icons.css' },
14+
];
15+
});
816

9-
return Promise.resolve()
10-
.then(() => silentNpm('install', 'material-design-icons@3.0.1'))
11-
.then(() => updateJsonFile('angular.json', workspaceJson => {
12-
const appArchitect = workspaceJson.projects['test-project'].architect;
13-
appArchitect.build.options.styles = [
14-
{ input: 'node_modules/material-design-icons/iconfont/material-icons.css' },
15-
];
16-
}))
17-
.then(() => ng('build', '--extract-css'))
18-
.then(() => expectFileToMatch('dist/test-project/styles.css', 'Material Icons'))
19-
.then(() => ng(
20-
'build',
21-
'--prod',
22-
'--extract-css',
23-
'--output-hashing=none'
24-
))
25-
.then(() => expectFileToMatch('dist/test-project/styles.css', 'Material Icons'));
17+
// Build dev application
18+
await ng('build', '--extract-css');
19+
20+
// Ensure icons are included
21+
await expectFileToMatch('dist/test-project/styles.css', 'Material Icons')
22+
23+
// Build prod application
24+
await ng('build', '--prod', '--extract-css', '--output-hashing=none');
25+
26+
// Ensure icons are included
27+
await expectFileToMatch('dist/test-project/styles.css', 'Material Icons')
2628
}

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6632,11 +6632,6 @@ marked@0.7.0:
66326632
resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e"
66336633
integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==
66346634

6635-
material-design-icons@^3.0.1:
6636-
version "3.0.1"
6637-
resolved "https://registry.yarnpkg.com/material-design-icons/-/material-design-icons-3.0.1.tgz#9a71c48747218ebca51e51a66da682038cdcb7bf"
6638-
integrity sha1-mnHEh0chjrylHlGmbaaCA4zct78=
6639-
66406635
math-random@^1.0.1:
66416636
version "1.0.1"
66426637
resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac"

0 commit comments

Comments
 (0)