Skip to content

Commit 6937123

Browse files
committed
fix(@schematics/angular): directly resolve karma config template in migration
To attempt to workaround Windows pathing issues in the karma configuration migration, the default karma template is now resolved via `require.resolve`. (cherry picked from commit 6c7b798)
1 parent 8d7e38d commit 6937123

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/schematics/angular/migrations/karma/karma-config-comparer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function generateDefaultKarmaConfig(
4141
projectName: string,
4242
needDevkitPlugin: boolean,
4343
): Promise<string> {
44-
const templatePath = path.join(__dirname, '../../config/files/karma.conf.js.template');
44+
const templatePath = require.resolve('../../config/files/karma.conf.js.template');
4545
let template = await readFile(templatePath, 'utf-8');
4646

4747
// TODO: Replace this with the actual schematic templating logic.

packages/schematics/angular/migrations/migration-collection.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"encapsulation": false,
23
"schematics": {
34
"replace-provide-server-rendering-import": {
45
"version": "20.0.0",

0 commit comments

Comments
 (0)