diff --git a/package.json b/package.json index cf5b047e3c..f7ae85b2b4 100644 --- a/package.json +++ b/package.json @@ -14,21 +14,21 @@ "start:electron-wait-webpack-win": "cross-env-shell wait-for-localhost $SERVER_PORT && npm run electron-win", "start:dev": "npm-run-all --parallel start:watch start:electron-wait-webpack", "start:dev-win": "npm-run-all --parallel start:watch start:electron-wait-webpack-win", - "build": "webpack --mode=production --node-env=production --config webpack.config.js", - "build:dev": "webpack --mode=development --node-env=development --config webpack.config.js", - "build:deps": "webpack --config webpack.node.config.js --stats detailed | grep 'node_modules' | sed -E 's/.*(node_modules[\\/][^\\\\/[:space:]]{1,})[\\\\/].*/\\1/' | uniq | node save-node-deps.js", + "build": "rspack --mode=production --node-env=production --config rspack.config.js", + "build:dev": "rspack --mode=development --node-env=development --config rspack.config.js", + "build:deps": "rspack --config rspack.node.config.js --stats detailed | grep 'node_modules' | sed -E 's/.*(node_modules[\\/][^\\\\/[:space:]]{1,})[\\\\/].*/\\1/' | uniq | node save-node-deps.js", "build:nmh": "go build -o dist/nativeMessagingHost ./go/nativeMessagingHost.go", "build:nmh-win": "go build -o dist/nativeMessagingHost.exe ./go/nativeMessagingHost.go", - "dist:mac": "npm run build:deps && webpack --progress --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64 --x64", - "dist:macarm": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64", - "dist:macamd": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --x64", - "dist:win": "webpack --mode=production --node-env=production && electron-builder --windows", - "dist:linux": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64 --x64", - "dist:linuxamd": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --x64", - "dist:linuxarm": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64", - "publish:mac": "webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --macos --publish always", - "publish:linux": "webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --linux --publish always", - "publish:win": "webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --windows --publish always", + "dist:mac": "npm run build:deps && rspack --progress --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64 --x64", + "dist:macarm": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64", + "dist:macamd": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --x64", + "dist:win": "rspack --mode=production --node-env=production && electron-builder --windows", + "dist:linux": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64 --x64", + "dist:linuxamd": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --x64", + "dist:linuxarm": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64", + "publish:mac": "rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --macos --publish always", + "publish:linux": "rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --linux --publish always", + "publish:win": "rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --windows --publish always", "postinstall": "npx patch-package && electron-builder install-app-deps", "prepare": "husky install", "update:locale": "node ./electron/hook/locale.js" @@ -292,270 +292,6 @@ { "from": "node_modules/mime-types", "to": "node_modules/mime-types" - }, - { - "from": "node_modules/@electron", - "to": "node_modules/@electron" - }, - { - "from": "node_modules/async", - "to": "node_modules/async" - }, - { - "from": "node_modules/balanced-match", - "to": "node_modules/balanced-match" - }, - { - "from": "node_modules/brace-expansion", - "to": "node_modules/brace-expansion" - }, - { - "from": "node_modules/builder-util-runtime", - "to": "node_modules/builder-util-runtime" - }, - { - "from": "node_modules/concat-map", - "to": "node_modules/concat-map" - }, - { - "from": "node_modules/core-util-is", - "to": "node_modules/core-util-is" - }, - { - "from": "node_modules/debug", - "to": "node_modules/debug" - }, - { - "from": "node_modules/electron-dl", - "to": "node_modules/electron-dl" - }, - { - "from": "node_modules/electron-is-dev", - "to": "node_modules/electron-is-dev" - }, - { - "from": "node_modules/electron-json-storage", - "to": "node_modules/electron-json-storage" - }, - { - "from": "node_modules/electron-log", - "to": "node_modules/electron-log" - }, - { - "from": "node_modules/electron-updater", - "to": "node_modules/electron-updater" - }, - { - "from": "node_modules/electron-util", - "to": "node_modules/electron-util" - }, - { - "from": "node_modules/electron-window-state", - "to": "node_modules/electron-window-state" - }, - { - "from": "node_modules/ext-list", - "to": "node_modules/ext-list" - }, - { - "from": "node_modules/ext-name", - "to": "node_modules/ext-name" - }, - { - "from": "node_modules/fs-extra", - "to": "node_modules/fs-extra" - }, - { - "from": "node_modules/fs.realpath", - "to": "node_modules/fs.realpath" - }, - { - "from": "node_modules/glob", - "to": "node_modules/glob" - }, - { - "from": "node_modules/graceful-fs", - "to": "node_modules/graceful-fs" - }, - { - "from": "node_modules/has-flag", - "to": "node_modules/has-flag" - }, - { - "from": "node_modules/if-async", - "to": "node_modules/if-async" - }, - { - "from": "node_modules/imurmurhash", - "to": "node_modules/imurmurhash" - }, - { - "from": "node_modules/inflight", - "to": "node_modules/inflight" - }, - { - "from": "node_modules/inherits", - "to": "node_modules/inherits" - }, - { - "from": "node_modules/is-plain-obj", - "to": "node_modules/is-plain-obj" - }, - { - "from": "node_modules/isarray", - "to": "node_modules/isarray" - }, - { - "from": "node_modules/js-yaml", - "to": "node_modules/js-yaml" - }, - { - "from": "node_modules/jsonfile", - "to": "node_modules/jsonfile" - }, - { - "from": "node_modules/keytar", - "to": "node_modules/keytar" - }, - { - "from": "node_modules/lazy-val", - "to": "node_modules/lazy-val" - }, - { - "from": "node_modules/lockfile", - "to": "node_modules/lockfile" - }, - { - "from": "node_modules/lodash", - "to": "node_modules/lodash" - }, - { - "from": "node_modules/lodash.escaperegexp", - "to": "node_modules/lodash.escaperegexp" - }, - { - "from": "node_modules/lodash.isequal", - "to": "node_modules/lodash.isequal" - }, - { - "from": "node_modules/mime-db", - "to": "node_modules/mime-db" - }, - { - "from": "node_modules/minimatch", - "to": "node_modules/minimatch" - }, - { - "from": "node_modules/mkdirp", - "to": "node_modules/mkdirp" - }, - { - "from": "node_modules/modify-filename", - "to": "node_modules/modify-filename" - }, - { - "from": "node_modules/ms", - "to": "node_modules/ms" - }, - { - "from": "node_modules/new-github-issue-url", - "to": "node_modules/new-github-issue-url" - }, - { - "from": "node_modules/once", - "to": "node_modules/once" - }, - { - "from": "node_modules/path-exists", - "to": "node_modules/path-exists" - }, - { - "from": "node_modules/path-is-absolute", - "to": "node_modules/path-is-absolute" - }, - { - "from": "node_modules/pupa", - "to": "node_modules/pupa" - }, - { - "from": "node_modules/readable-stream", - "to": "node_modules/readable-stream" - }, - { - "from": "node_modules/regedit", - "to": "node_modules/regedit" - }, - { - "from": "node_modules/rimraf", - "to": "node_modules/rimraf" - }, - { - "from": "node_modules/sanitize-filename", - "to": "node_modules/sanitize-filename" - }, - { - "from": "node_modules/sax", - "to": "node_modules/sax" - }, - { - "from": "node_modules/semver", - "to": "node_modules/semver" - }, - { - "from": "node_modules/signal-exit", - "to": "node_modules/signal-exit" - }, - { - "from": "node_modules/sort-keys", - "to": "node_modules/sort-keys" - }, - { - "from": "node_modules/sort-keys-length", - "to": "node_modules/sort-keys-length" - }, - { - "from": "node_modules/stream-slicer", - "to": "node_modules/stream-slicer" - }, - { - "from": "node_modules/string_decoder", - "to": "node_modules/string_decoder" - }, - { - "from": "node_modules/supports-color", - "to": "node_modules/supports-color" - }, - { - "from": "node_modules/systeminformation", - "to": "node_modules/systeminformation" - }, - { - "from": "node_modules/through2", - "to": "node_modules/through2" - }, - { - "from": "node_modules/truncate-utf8-bytes", - "to": "node_modules/truncate-utf8-bytes" - }, - { - "from": "node_modules/universalify", - "to": "node_modules/universalify" - }, - { - "from": "node_modules/unused-filename", - "to": "node_modules/unused-filename" - }, - { - "from": "node_modules/wrappy", - "to": "node_modules/wrappy" - }, - { - "from": "node_modules/write-file-atomic", - "to": "node_modules/write-file-atomic" - }, - { - "from": "node_modules/xtend", - "to": "node_modules/xtend" } ], "dmg": { @@ -648,4 +384,4 @@ "pre-commit": "npm run precommit && git add licenses.json" } } -} +} \ No newline at end of file diff --git a/webpack.config.js b/rspack.config.js similarity index 97% rename from webpack.config.js rename to rspack.config.js index b785c86dbe..3fccfc3abb 100644 --- a/webpack.config.js +++ b/rspack.config.js @@ -1,6 +1,6 @@ const path = require('path'); const process = require('process'); -const webpack = require('webpack'); +const rspack = require('@rspack/core'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; @@ -116,7 +116,7 @@ module.exports = (env, argv) => { plugins: [ //new BundleAnalyzerPlugin(), - new webpack.optimize.LimitChunkCountPlugin({ + new rspack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), diff --git a/webpack.node.config.js b/rspack.node.config.js similarity index 100% rename from webpack.node.config.js rename to rspack.node.config.js