File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ if (process.env['CODE_COVERAGE'] || process.argv.indexOf('--code-coverage') !==
26
26
let profiler = null ;
27
27
if ( process . env [ 'DEVKIT_PROFILING' ] ) {
28
28
try {
29
- profiler = require ( 'v8-profiler' ) ;
29
+ profiler = require ( 'v8-profiler-node8 ' ) ;
30
30
} catch ( err ) {
31
- throw new Error ( `Could not require 'v8-profiler'. You must install it separetely with` +
32
- `'npm install v8-profiler --no-save.\n\nOriginal error:\n\n${ err } ` ) ;
31
+ throw new Error ( `Could not require 'v8-profiler-node8 '. You must install it separetely with` +
32
+ `'npm install v8-profiler-node8 --no-save.\n\nOriginal error:\n\n${ err } ` ) ;
33
33
}
34
34
35
35
profiler . startProfiling ( ) ;
Original file line number Diff line number Diff line change @@ -43,8 +43,16 @@ function _fromPackageJson(cwd?: string) {
43
43
44
44
// Check if we need to profile this CLI run.
45
45
if ( process . env [ 'NG_CLI_PROFILING' ] ) {
46
- const profiler = require ( 'v8-profiler' ) ; // tslint:disable-line:no-implicit-dependencies
46
+ let profiler : any = null ;
47
+ try {
48
+ profiler = require ( 'v8-profiler-node8' ) ; // tslint:disable-line:no-implicit-dependencies
49
+ } catch ( err ) {
50
+ throw new Error ( `Could not require 'v8-profiler-node8'. You must install it separetely with` +
51
+ `'npm install v8-profiler-node8 --no-save.\n\nOriginal error:\n\n${ err } ` ) ;
52
+ }
53
+
47
54
profiler . startProfiling ( ) ;
55
+
48
56
const exitHandler = ( options : { cleanup ?: boolean , exit ?: boolean } ) => {
49
57
if ( options . cleanup ) {
50
58
const cpuProfile = profiler . stopProfiling ( ) ;
You can’t perform that action at this time.
0 commit comments