INFRA: Update Webpack to @latest, along with other dev packages (#290)

This commit is contained in:
David Walker 2023-01-05 17:29:02 -08:00 committed by GitHub
parent a76e281349
commit c42fde9379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2833 additions and 12258 deletions

15053
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -52,7 +52,7 @@
"@babel/preset-typescript": "^7.15.0",
"@microsoft/api-documenter": "^7.13.65",
"@microsoft/api-extractor": "^7.18.17",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@testing-library/cypress": "^8.0.1",
"@types/acorn": "^4.0.6",
"@types/bcryptjs": "^2.4.2",
@ -69,28 +69,28 @@
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"babel-jest": "^27.0.6",
"babel-loader": "^8.0.5",
"babel-loader": "^9.1.0",
"cypress": "^8.3.1",
"electron": "^14.2.4",
"electron-packager": "^15.4.0",
"eslint": "^8.13.0",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^6.3.3",
"html-webpack-plugin": "^4.5.2",
"html-webpack-plugin": "^5.5.0",
"http-server": "^13.0.1",
"jest": "^27.1.0",
"jsdom": "^16.5.0",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^0.4.1",
"mini-css-extract-plugin": "^2.7.2",
"prettier": "^2.3.2",
"raw-loader": "^4.0.2",
"react-refresh": "^0.10.0",
"react-refresh": "^0.14.0",
"source-map": "^0.7.3",
"start-server-and-test": "^1.14.0",
"typescript": "^4.2.4",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2"
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
},
"engines": {
"node": ">=14"
@ -110,9 +110,9 @@
"format:report": "prettier -c .",
"format:report-diff": "bash -c 'if [[ $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | wc -c) -ne 0 ]]; then prettier -c $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | xargs); fi'",
"start": "http-server -p 8000",
"start:dev": "webpack-dev-server --progress --env.devServer --mode development",
"start:dev-fast": "webpack-dev-server --progress --env.devServer --mode development --fast true",
"start:container": "webpack-dev-server --progress --env.devServer --mode development --env.runInContainer",
"start:dev": "webpack serve --progress --env devServer --mode development",
"start:dev-fast": "webpack serve --progress --env devServer --mode development --fast true",
"start:container": "webpack serve --progress --env devServer --mode development --env runInContainer",
"build": "webpack --mode production",
"build:dev": "webpack --mode development",
"lint": "eslint --fix --ext js,jsx,ts,tsx --max-warnings 0 src",
@ -124,7 +124,7 @@
"test:watch": "jest --watch",
"watch": "webpack --watch --mode production",
"watch:dev": "webpack --watch --mode development",
"electron": "sh ./tools/package-electron.sh",
"electron": "bash ./tools/package-electron.sh",
"electron:packager": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png --no-prune",
"electron:packager-all": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png",
"electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png",

@ -20,7 +20,7 @@ import { SpecialServers } from "../Server/data/SpecialServers";
import { Server } from "../Server/Server";
import { Router } from "../ui/GameRoot";
import { Page } from "../ui/Router";
import * as data from "./AchievementData.json";
import data from "./AchievementData.json";
import { FactionNames } from "../Faction/data/FactionNames";
import { BlackOperationNames } from "../Bladeburner/data/BlackOperationNames";
import { isClassWork } from "../Work/ClassWork";

2
tools/package-electron.sh Normal file → Executable file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -euxo pipefail

@ -28,8 +28,10 @@ module.exports = (env, argv) => {
const devServerSettings = {
hot: true,
port: 8000,
publicPath: `/`,
stats: statsConfig,
devMiddleware: {
publicPath: `/`,
stats: statsConfig,
},
};
// By default, the webpack-dev-server is not exposed outside of localhost.
@ -165,13 +167,10 @@ module.exports = (env, argv) => {
removeEmptyChunks: true,
mergeDuplicateChunks: true,
flagIncludedChunks: true,
occurrenceOrder: true,
sideEffects: true,
providedExports: true,
usedExports: true,
concatenateModules: false,
namedModules: false,
namedChunks: false,
minimize: !isDevelopment,
portableRecords: true,
splitChunks: {
@ -191,6 +190,7 @@ module.exports = (env, argv) => {
"@player": path.resolve(__dirname, "src/Player"),
"@nsdefs": path.resolve(__dirname, "src/ScriptEditor/NetscriptDefinitions.d.ts"),
},
fallback: { crypto: false },
},
stats: statsConfig,
};