cyberchef/rspack.dev.config.js
consigcody94 1ac3190dae Modernize CyberChef build system, dependencies, UI, and testing
Build System:
- Replace Grunt with npm scripts and Node.js helper scripts
- Remove worker-loader, use native Webpack 5 worker syntax
- Add Rspack config as faster alternative bundler (5-23x faster)
- Replace platform-specific sed postinstall hacks with cross-platform Node.js script
- Update browser targets from Chrome 50/Firefox 38 to Chrome 80/Firefox 78/Safari 14
- Fix import assertions (assert -> with) for Node 24 compatibility

Dependencies:
- Replace deprecated crypto-js with native RC4 implementation and @noble/hashes EVP KDF
- Replace blakejs with @noble/hashes/blake2b and blake2s
- Add @noble/hashes for MD5, SHA1/2/3, RIPEMD160, HMAC, HKDF (crypto-api fallback for legacy algos)
- Replace lodash with native CaseConvert.mjs utility
- Replace moment.js in web layer with date-fns
- Add date-fns and date-fns-tz dependencies
- Remove jquery, snackbarjs, arrive, bootstrap-colorpicker, bootstrap-material-design, popper.js v1, lodash, blakejs, crypto-js

UI Modernization:
- Upgrade Bootstrap 4.6.2 to Bootstrap 5.3 (87 data attribute renames)
- Remove bootstrap-material-design (unmaintained)
- Remove jQuery dependency entirely (38 calls replaced with native DOM + BS5 JS API)
- Add custom Snackbar.mjs notification utility (replaces snackbarjs)
- Replace bootstrap-colorpicker with native HTML color input

Testing:
- Add Vitest config and adapter for running existing TestRegister tests
- Add Playwright config and E2E test replacing Nightwatch
- Update CI workflows to use npm scripts and Playwright
2026-03-23 13:59:24 -04:00

52 lines
1.6 KiB
JavaScript

"use strict";
const rspack = require("@rspack/core");
const baseConfig = require("./rspack.config.js");
const { listEntryModules } = require("./scripts/listEntryModulesSync.cjs");
const pkg = require("./package.json");
const d = new Date();
const compileYear = d.getUTCFullYear().toString();
const compileTime = `${String(d.getUTCDate()).padStart(2, "0")}/${String(d.getUTCMonth() + 1).padStart(2, "0")}/${d.getUTCFullYear()} ${String(d.getUTCHours()).padStart(2, "0")}:${String(d.getUTCMinutes()).padStart(2, "0")}:${String(d.getUTCSeconds()).padStart(2, "0")} UTC`;
const BUILD_CONSTANTS = {
COMPILE_YEAR: JSON.stringify(compileYear),
COMPILE_TIME: JSON.stringify(compileTime),
COMPILE_MSG: JSON.stringify(process.env.COMPILE_MSG || ""),
PKG_VERSION: JSON.stringify(pkg.version),
};
const moduleEntryPoints = listEntryModules();
module.exports = {
...baseConfig,
mode: "development",
target: "web",
entry: Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints),
resolve: {
...baseConfig.resolve,
alias: {
...baseConfig.resolve.alias,
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
}
},
devServer: {
port: parseInt(process.env.PORT || "8080", 10),
client: {
logging: "error",
overlay: true
},
hot: "only"
},
plugins: [
...baseConfig.plugins,
new rspack.DefinePlugin(BUILD_CONSTANTS),
new rspack.HtmlRspackPlugin({
filename: "index.html",
template: "./src/web/html/index.html",
}),
]
};