File tree Expand file tree Collapse file tree 4 files changed +264
-290
lines changed Expand file tree Collapse file tree 4 files changed +264
-290
lines changed Original file line number Diff line number Diff line change 362
362
},
363
363
"devDependencies" : {
364
364
"@types/glob" : " ^7.2.0" ,
365
- "@types/js-yaml" : " ^4.0.3 " ,
365
+ "@types/js-yaml" : " ^4.0.5 " ,
366
366
"@types/mocha" : " ^9.0.0" ,
367
- "node-fetch" : " ^3.x" ,
368
367
"@types/vscode" : " ^1.61.0" ,
369
368
"@types/webpack-env" : " ^1.16.2" ,
370
- "@typescript-eslint/eslint-plugin" : " ^5.2 .0" ,
371
- "@typescript-eslint/parser" : " ^5.2 .0" ,
369
+ "@typescript-eslint/eslint-plugin" : " ^5.5 .0" ,
370
+ "@typescript-eslint/parser" : " ^5.5 .0" ,
372
371
"@vscode/test-web" : " ^0.0.15" ,
373
372
"assert" : " ^2.0.0" ,
374
373
"del" : " ^6.0.0" ,
375
374
"download" : " ^8.0.0" ,
376
375
"emulators" : " ^0.72.0" ,
377
- "eslint" : " ^8.1 .0" ,
376
+ "eslint" : " ^8.4 .0" ,
378
377
"glob" : " ^7.2.0" ,
379
378
"js-yaml" : " ^4.0.0" ,
380
379
"jszip" : " ^3.7.1" ,
381
380
"mocha" : " ^9.1.3" ,
382
- "node-fetch" : " ^2 .x" ,
381
+ "node-fetch" : " ^3 .x" ,
383
382
"path-browserify" : " ^1.0.1" ,
384
383
"process" : " ^0.11.10" ,
385
384
"rimraf" : " ^3.0.2" ,
386
385
"ts-loader" : " ^9.2.6" ,
387
- "typescript" : " ^4.4.4 " ,
386
+ "typescript" : " ^4.5.2 " ,
388
387
"vscode-test" : " ^1.4.1" ,
389
388
"vscode-uri" : " ^3.0.2" ,
390
- "webpack" : " ^5.60.0 " ,
389
+ "webpack" : " ^5.64.4 " ,
391
390
"webpack-cli" : " ^4.9.1"
392
391
},
393
392
"repository" : {
Original file line number Diff line number Diff line change 2
2
* API for downloading information from web
3
3
*/
4
4
import { logger } from "./logger" ;
5
- import * as fetch from 'node-fetch' ;
6
5
7
6
export async function downloadFromMultiSources ( urls : string [ ] ) : Promise < string | undefined > {
8
7
for ( const url of urls ) {
9
8
try {
10
- const data = await fetch . default ( url ) ;
9
+ const data = await fetch ( url ) ;
11
10
const val = await data . text ( ) ;
12
11
if ( val ) {
13
12
return val ;
Original file line number Diff line number Diff line change 8
8
'use strict' ;
9
9
10
10
const path = require ( 'path' ) ;
11
+ const webpack = require ( 'webpack' ) ;
11
12
/** @typedef {import('webpack').Configuration } WebpackConfig **/
12
13
13
14
/** @type WebpackConfig */
@@ -46,13 +47,16 @@ const config = {
46
47
} ]
47
48
} ]
48
49
} ,
50
+ plugins : [
51
+ new webpack . ProvidePlugin ( {
52
+ fetch : 'node-fetch' ,
53
+ } ) ,
54
+ ] ,
49
55
optimization : {
50
56
minimize : true
51
57
}
52
58
} ;
53
59
54
- const webpack = require ( 'webpack' ) ;
55
-
56
60
/** @type WebpackConfig */
57
61
const webExtensionConfig = {
58
62
mode : 'none' , // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
@@ -101,7 +105,6 @@ const webExtensionConfig = {
101
105
] ,
102
106
externals : {
103
107
vscode : 'commonjs vscode' , // ignored because it doesn't exist
104
- 'node-fetch' : 'window fetch'
105
108
} ,
106
109
performance : {
107
110
hints : false ,
You can’t perform that action at this time.
0 commit comments