File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 27
27
console . error ( err )
28
28
process . exit ( 1 )
29
29
} finally {
30
- process . chdir ( CWD )
30
+ process . chdir ( CWD )
31
31
}
Original file line number Diff line number Diff line change 16
16
" apm"
17
17
],
18
18
"author" : " Thomas Hunter II <tlhunter@datadog.com>" ,
19
- "license" : " ISC"
19
+ "license" : " ISC" ,
20
+ "dependencies" : {
21
+ "esbuild" : " 0.16.12" ,
22
+ "express" : " ^4.16.2"
23
+ }
20
24
}
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ const NAMESPACE = 'datadog'
3
3
const instrumented = Object . keys ( require ( '../datadog-instrumentations/src/helpers/hooks.js' ) )
4
4
const rawBuiltins = require ( 'module' ) . builtinModules
5
5
6
+ warnIfUnsupported ( )
7
+
6
8
const builtins = new Set ( )
7
9
8
10
for ( const builtin of rawBuiltins ) {
@@ -88,3 +90,13 @@ module.exports.setup = function (build) {
88
90
}
89
91
} )
90
92
}
93
+
94
+ function warnIfUnsupported ( ) {
95
+ const [ major , minor ] = process . versions . node . split ( '.' ) . map ( Number ) ;
96
+ if ( major < 14 || major == 14 && minor < 17 ) {
97
+ console . error ( 'WARNING: Esbuild support isn\'t available for older versions of Node.js.' )
98
+ console . error ( `Expected: Node.js >= v14.17. Actual: Node.js = ${ process . version } .` )
99
+ console . error ( 'This application may build properly with this version of Node.js, but unless a' )
100
+ console . error ( 'more recent version is used at runtime, third party packages won\'t be instrumented.' )
101
+ }
102
+ }
You can’t perform that action at this time.
0 commit comments