Skip to content

Commit b85bb6e

Browse files
alan-agius4devversion
authored andcommitted
fix(material/schematics): remove node_modules prefix from prebuilt theme
The Angular CLI supports resolving node modules without the need of specifying `node_modules` directory. This also needed to add support for Yarn PNP which doesn't create a `node_modules` directory. Closes #25242 (cherry picked from commit be0b688)
1 parent 9a79b80 commit b85bb6e

File tree

6 files changed

+1467
-1234
lines changed

6 files changed

+1467
-1234
lines changed

integration/yarn-pnp-compat/angular.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"tsConfig": "tsconfig.app.json",
2828
"inlineStyleLanguage": "scss",
2929
"assets": ["src/favicon.ico", "src/assets"],
30-
"styles": ["src/styles.scss"],
30+
"styles": ["@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss"],
3131
"scripts": []
3232
},
3333
"configurations": {
@@ -90,10 +90,7 @@
9090
"karmaConfig": "karma.conf.js",
9191
"inlineStyleLanguage": "scss",
9292
"assets": ["src/favicon.ico", "src/assets"],
93-
"styles": [
94-
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
95-
"src/styles.scss"
96-
],
93+
"styles": ["@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss"],
9794
"scripts": []
9895
}
9996
}

integration/yarn-pnp-compat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"zone.js": "~0.11.4"
2727
},
2828
"devDependencies": {
29-
"@angular-devkit/build-angular": "^15.0.0-next.0",
30-
"@angular/cli": "^15.0.0-next.0",
29+
"@angular-devkit/build-angular": "^15.0.0-next.6",
30+
"@angular/cli": "^15.0.0-next.6",
3131
"@angular/compiler-cli": "^15.0.0-next.0",
3232
"@types/jasmine": "~3.10.0",
3333
"@types/node": "^12.11.1",

integration/yarn-pnp-compat/src/test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,5 @@ import {
77
platformBrowserDynamicTesting,
88
} from '@angular/platform-browser-dynamic/testing';
99

10-
declare const require: {
11-
context(
12-
path: string,
13-
deep?: boolean,
14-
filter?: RegExp,
15-
): {
16-
<T>(id: string): T;
17-
keys(): string[];
18-
};
19-
};
20-
2110
// First, initialize the Angular testing environment.
2211
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
23-
24-
// Then we find all the tests.
25-
const context = require.context('./', true, /\.spec\.ts$/);
26-
// And load the modules.
27-
context.keys().map(context);

0 commit comments

Comments
 (0)