mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-19 09:16:38 +00:00
Merge pull request #4211 from balena-io/fix-url-loading
patch: bump etcher-sdk to 9.0.11 to fix url loading using http/2
This commit is contained in:
commit
c5a8bfc0dc
35380
npm-shrinkwrap.json
generated
35380
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
@ -40,7 +40,7 @@
|
|||||||
"drivelist": "^12.0.2",
|
"drivelist": "^12.0.2",
|
||||||
"electron-squirrel-startup": "^1.0.0",
|
"electron-squirrel-startup": "^1.0.0",
|
||||||
"electron-updater": "6.1.8",
|
"electron-updater": "6.1.8",
|
||||||
"etcher-sdk": "9.0.9",
|
"etcher-sdk": "9.0.11",
|
||||||
"i18next": "23.11.2",
|
"i18next": "23.11.2",
|
||||||
"immutable": "3.8.2",
|
"immutable": "3.8.2",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
|
@ -17,29 +17,7 @@
|
|||||||
import type { Configuration, ModuleOptions } from 'webpack';
|
import type { Configuration, ModuleOptions } from 'webpack';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
|
|
||||||
import {
|
import { BannerPlugin, IgnorePlugin } from 'webpack';
|
||||||
BannerPlugin,
|
|
||||||
IgnorePlugin,
|
|
||||||
NormalModuleReplacementPlugin,
|
|
||||||
} from 'webpack';
|
|
||||||
|
|
||||||
interface ReplacementRule {
|
|
||||||
search: string;
|
|
||||||
replace: string | (() => string);
|
|
||||||
}
|
|
||||||
|
|
||||||
function slashOrAntislash(pattern: RegExp): RegExp {
|
|
||||||
return new RegExp(pattern.source.replace(/\\\//g, '(\\/|\\\\)'));
|
|
||||||
}
|
|
||||||
|
|
||||||
function replace(test: RegExp, ...replacements: ReplacementRule[]) {
|
|
||||||
return {
|
|
||||||
loader: 'string-replace-loader',
|
|
||||||
// Handle windows path separators
|
|
||||||
test: slashOrAntislash(test),
|
|
||||||
options: { multiple: replacements.map((r) => ({ ...r, strict: true })) },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const rules: Required<ModuleOptions>['rules'] = [
|
const rules: Required<ModuleOptions>['rules'] = [
|
||||||
// Add support for native node modules
|
// Add support for native node modules
|
||||||
@ -81,11 +59,6 @@ const rules: Required<ModuleOptions>['rules'] = [
|
|||||||
test: /\.svg$/,
|
test: /\.svg$/,
|
||||||
use: '@svgr/webpack',
|
use: '@svgr/webpack',
|
||||||
},
|
},
|
||||||
// force axios to use http backend (not xhr) to support streams
|
|
||||||
replace(/node_modules\/axios\/lib\/defaults\.js$/, {
|
|
||||||
search: './adapters/xhr',
|
|
||||||
replace: './adapters/http',
|
|
||||||
}),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const rendererConfig: Configuration = {
|
export const rendererConfig: Configuration = {
|
||||||
@ -93,12 +66,6 @@ export const rendererConfig: Configuration = {
|
|||||||
rules,
|
rules,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// Force axios to use http.js, not xhr.js as we need stream support
|
|
||||||
// (its package.json file replaces http with xhr for browser targets).
|
|
||||||
new NormalModuleReplacementPlugin(
|
|
||||||
slashOrAntislash(/node_modules\/axios\/lib\/adapters\/xhr\.js/),
|
|
||||||
'./http.js',
|
|
||||||
),
|
|
||||||
// Ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used
|
// Ignore `aws-crt` which is a dependency of (ultimately) `aws4-axios` which is used
|
||||||
// by etcher-sdk and does a runtime check to its availability. We’re not currently
|
// by etcher-sdk and does a runtime check to its availability. We’re not currently
|
||||||
// using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that
|
// using the “assume role” functionality (AFAIU) of aws4-axios and we don’t care that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user