Update webpack to v5

Changelog-entry: Update webpack to v5
Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-12-23 19:42:51 +01:00
parent e8c7591751
commit b74069eb41
3 changed files with 2076 additions and 4014 deletions

6056
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -52,23 +52,23 @@
"devDependencies": { "devDependencies": {
"@balena/lint": "^5.0.4", "@balena/lint": "^5.0.4",
"@fortawesome/fontawesome-free": "^5.13.1", "@fortawesome/fontawesome-free": "^5.13.1",
"@svgr/webpack": "^5.4.0", "@svgr/webpack": "^5.5.0",
"@types/chai": "^4.2.7", "@types/chai": "^4.2.7",
"@types/copy-webpack-plugin": "^6.0.0", "@types/copy-webpack-plugin": "^6.0.0",
"@types/mime-types": "^2.1.0", "@types/mime-types": "^2.1.0",
"@types/mini-css-extract-plugin": "^0.9.1", "@types/mini-css-extract-plugin": "^1.2.2",
"@types/mocha": "^8.0.3", "@types/mocha": "^8.0.3",
"@types/node": "^12.12.39", "@types/node": "^12.12.39",
"@types/node-ipc": "^9.1.2", "@types/node-ipc": "^9.1.2",
"@types/react-dom": "^16.8.4", "@types/react-dom": "^16.8.4",
"@types/semver": "^7.1.0", "@types/semver": "^7.1.0",
"@types/sinon": "^9.0.0", "@types/sinon": "^9.0.0",
"@types/terser-webpack-plugin": "^4.1.0", "@types/terser-webpack-plugin": "^5.0.2",
"@types/tmp": "^0.2.0", "@types/tmp": "^0.2.0",
"@types/webpack-node-externals": "^2.5.0", "@types/webpack-node-externals": "^2.5.0",
"chai": "^4.2.0", "chai": "^4.2.0",
"copy-webpack-plugin": "^6.0.1", "copy-webpack-plugin": "^7.0.0",
"css-loader": "^4.2.1", "css-loader": "^5.0.1",
"d3": "^4.13.0", "d3": "^4.13.0",
"debug": "^4.2.0", "debug": "^4.2.0",
"electron": "9.4.0", "electron": "9.4.0",
@ -78,12 +78,12 @@
"electron-rebuild": "^2.3.2", "electron-rebuild": "^2.3.2",
"electron-updater": "^4.3.5", "electron-updater": "^4.3.5",
"etcher-sdk": "^5.1.11", "etcher-sdk": "^5.1.11",
"file-loader": "^6.0.0", "file-loader": "^6.2.0",
"husky": "^4.2.5", "husky": "^4.2.5",
"immutable": "^3.8.1", "immutable": "^3.8.1",
"lint-staged": "^10.2.2", "lint-staged": "^10.2.2",
"lodash": "^4.17.10", "lodash": "^4.17.10",
"mini-css-extract-plugin": "^0.10.0", "mini-css-extract-plugin": "^1.3.3",
"mocha": "^8.0.1", "mocha": "^8.0.1",
"native-addon-loader": "^2.0.1", "native-addon-loader": "^2.0.1",
"node-ipc": "^9.1.1", "node-ipc": "^9.1.1",
@ -100,17 +100,18 @@
"simple-progress-webpack-plugin": "^1.1.2", "simple-progress-webpack-plugin": "^1.1.2",
"sinon": "^9.0.2", "sinon": "^9.0.2",
"spectron": "^11.0.0", "spectron": "^11.0.0",
"string-replace-loader": "^2.3.0", "string-replace-loader": "^3.0.1",
"styled-components": "^5.1.0", "styled-components": "^5.1.0",
"sudo-prompt": "github:zvin/sudo-prompt#7cdede2f0da28fbcc2db48402d7d935f3a825c91", "sudo-prompt": "github:zvin/sudo-prompt#7cdede2f0da28fbcc2db48402d7d935f3a825c91",
"sys-class-rgb-led": "^3.0.0", "sys-class-rgb-led": "^3.0.0",
"tmp": "^0.2.1", "tmp": "^0.2.1",
"ts-loader": "^8.0.0", "ts-loader": "^8.0.12",
"ts-node": "^9.0.0", "ts-node": "^9.0.0",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"typescript": "^4.1.2", "typescript": "^4.1.2",
"uuid": "^8.1.0", "uuid": "^8.1.0",
"webpack": "^4.40.2", "webpack": "^5.11.0",
"webpack-cli": "^3.3.9" "webpack-cli": "^4.2.0"
} },
"dependencies": {}
} }

View File

@ -32,8 +32,7 @@ import { BannerPlugin, NormalModuleReplacementPlugin } from 'webpack';
*/ */
function externalPackageJson(packageJsonPath: string) { function externalPackageJson(packageJsonPath: string) {
return ( return (
_context: string, { request }: { context: string; request: string },
request: string,
callback: (error?: Error | null, result?: string) => void, callback: (error?: Error | null, result?: string) => void,
) => { ) => {
if (_.endsWith(request, 'package.json')) { if (_.endsWith(request, 'package.json')) {
@ -50,8 +49,7 @@ function platformSpecificModule(
) { ) {
// Resolves module on platform, otherwise resolves the replacement // Resolves module on platform, otherwise resolves the replacement
return ( return (
_context: string, { request }: { context: string; request: string },
request: string,
callback: (error?: Error, result?: string, type?: string) => void, callback: (error?: Error, result?: string, type?: string) => void,
) => { ) => {
if (request === module && os.platform() !== platform) { if (request === module && os.platform() !== platform) {
@ -406,6 +404,7 @@ const cssConfig = {
index: path.join(__dirname, 'lib', 'gui', 'app', 'css', 'main.css'), index: path.join(__dirname, 'lib', 'gui', 'app', 'css', 'main.css'),
}, },
output: { output: {
publicPath: '',
path: path.join(__dirname, 'generated'), path: path.join(__dirname, 'generated'),
}, },
}; };