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 362362 },
363363 "devDependencies" : {
364364 "@types/glob" : " ^7.2.0" ,
365- "@types/js-yaml" : " ^4.0.3 " ,
365+ "@types/js-yaml" : " ^4.0.5 " ,
366366 "@types/mocha" : " ^9.0.0" ,
367- "node-fetch" : " ^3.x" ,
368367 "@types/vscode" : " ^1.61.0" ,
369368 "@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" ,
372371 "@vscode/test-web" : " ^0.0.15" ,
373372 "assert" : " ^2.0.0" ,
374373 "del" : " ^6.0.0" ,
375374 "download" : " ^8.0.0" ,
376375 "emulators" : " ^0.72.0" ,
377- "eslint" : " ^8.1 .0" ,
376+ "eslint" : " ^8.4 .0" ,
378377 "glob" : " ^7.2.0" ,
379378 "js-yaml" : " ^4.0.0" ,
380379 "jszip" : " ^3.7.1" ,
381380 "mocha" : " ^9.1.3" ,
382- "node-fetch" : " ^2 .x" ,
381+ "node-fetch" : " ^3 .x" ,
383382 "path-browserify" : " ^1.0.1" ,
384383 "process" : " ^0.11.10" ,
385384 "rimraf" : " ^3.0.2" ,
386385 "ts-loader" : " ^9.2.6" ,
387- "typescript" : " ^4.4.4 " ,
386+ "typescript" : " ^4.5.2 " ,
388387 "vscode-test" : " ^1.4.1" ,
389388 "vscode-uri" : " ^3.0.2" ,
390- "webpack" : " ^5.60.0 " ,
389+ "webpack" : " ^5.64.4 " ,
391390 "webpack-cli" : " ^4.9.1"
392391 },
393392 "repository" : {
Original file line number Diff line number Diff line change 22 * API for downloading information from web
33 */
44import { logger } from "./logger" ;
5- import * as fetch from 'node-fetch' ;
65
76export async function downloadFromMultiSources ( urls : string [ ] ) : Promise < string | undefined > {
87 for ( const url of urls ) {
98 try {
10- const data = await fetch . default ( url ) ;
9+ const data = await fetch ( url ) ;
1110 const val = await data . text ( ) ;
1211 if ( val ) {
1312 return val ;
Original file line number Diff line number Diff line change 88'use strict' ;
99
1010const path = require ( 'path' ) ;
11+ const webpack = require ( 'webpack' ) ;
1112/** @typedef {import('webpack').Configuration } WebpackConfig **/
1213
1314/** @type WebpackConfig */
@@ -46,13 +47,16 @@ const config = {
4647 } ]
4748 } ]
4849 } ,
50+ plugins : [
51+ new webpack . ProvidePlugin ( {
52+ fetch : 'node-fetch' ,
53+ } ) ,
54+ ] ,
4955 optimization : {
5056 minimize : true
5157 }
5258} ;
5359
54- const webpack = require ( 'webpack' ) ;
55-
5660/** @type WebpackConfig */
5761const webExtensionConfig = {
5862 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 = {
101105 ] ,
102106 externals : {
103107 vscode : 'commonjs vscode' , // ignored because it doesn't exist
104- 'node-fetch' : 'window fetch'
105108 } ,
106109 performance : {
107110 hints : false ,
You can’t perform that action at this time.
0 commit comments