File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 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') !==
2626let profiler = null ;
2727if ( process . env [ 'DEVKIT_PROFILING' ] ) {
2828 try {
29- profiler = require ( 'v8-profiler' ) ;
29+ profiler = require ( 'v8-profiler-node8 ' ) ;
3030 } 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 } ` ) ;
3333 }
3434
3535 profiler . startProfiling ( ) ;
Original file line number Diff line number Diff line change @@ -43,8 +43,16 @@ function _fromPackageJson(cwd?: string) {
4343
4444// Check if we need to profile this CLI run.
4545if ( 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+
4754 profiler . startProfiling ( ) ;
55+
4856 const exitHandler = ( options : { cleanup ?: boolean , exit ?: boolean } ) => {
4957 if ( options . cleanup ) {
5058 const cpuProfile = profiler . stopProfiling ( ) ;
You can’t perform that action at this time.
0 commit comments