|
1 | | -import { noop, Rule } from "@angular-devkit/schematics"; |
2 | | -import { execSync } from "child_process"; |
| 1 | +import { noop, Rule } from '@angular-devkit/schematics'; |
| 2 | +import { execSync } from 'child_process'; |
3 | 3 |
|
4 | | -// |
5 | | -// Schematic for patching Angular for rsbuild integration while experimental. |
| 4 | +// |
| 5 | +// Schematic for patching Angular for rsbuild integration while experimental. |
6 | 6 | // Will be removed when stable! |
7 | 7 | // Called via the init-rspack schematic to execute it AFTER the task running |
8 | 8 | // npm install |
9 | | -// |
| 9 | +// |
10 | 10 |
|
11 | 11 | export default function init(options: { workspaceRoot: string }): Rule { |
12 | 12 | return async function () { |
13 | | - |
14 | | - const cmd = 'node node_modules/@ng-rsbuild/plugin-angular/patch/patch-angular-build.js'; |
| 13 | + const cmd = |
| 14 | + 'node node_modules/@ng-rsbuild/plugin-angular/patch/patch-angular-build.js'; |
15 | 15 |
|
16 | 16 | try { |
17 | | - execSync(cmd, { |
18 | | - cwd: options.workspaceRoot |
19 | | - }); |
20 | | - } |
21 | | - catch(e) { |
22 | | - console.error('Error patching Angular for rspack'); |
23 | | - console.error('This is only needed while the rspack integration is experimental'); |
24 | | - console.error('Try to run this command by hand:') |
25 | | - console.error('\t' + cmd); |
26 | | - console.error('Error', e); |
| 17 | + execSync(cmd, { |
| 18 | + cwd: options.workspaceRoot, |
| 19 | + }); |
| 20 | + } catch (e) { |
| 21 | + console.error('Error patching Angular for rspack'); |
| 22 | + console.error( |
| 23 | + 'This is only needed while the rspack integration is experimental' |
| 24 | + ); |
| 25 | + console.error('Try to run this command by hand:'); |
| 26 | + console.error('\t' + cmd); |
| 27 | + console.error('Error', e); |
27 | 28 | } |
28 | 29 |
|
29 | 30 | return noop(); |
|
0 commit comments