diff --git a/package.json b/package.json index f7ae85b2b4..ddc8334ea6 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,12 @@ "start:dev-win": "npm-run-all --parallel start:watch start:electron-wait-webpack-win", "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:deps": "rspack build --config rspack.node.config.js --json=compilation-stats.json", + "_build:deps_webpack": "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: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 && 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:mac": "rspack --mode=production --node-env=production --json=compilation-stats.json", + "dist:mac_webpack": "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", diff --git a/rspack.config.js b/rspack.config.js index 0f94ee86ee..7fa333fc37 100644 --- a/rspack.config.js +++ b/rspack.config.js @@ -1,8 +1,7 @@ const path = require('path'); const process = require('process'); const rspack = require('@rspack/core'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json')); const cMapsDir = path.join(pdfjsDistPath, 'cmaps'); @@ -113,18 +112,19 @@ module.exports = (env, argv) => { } ] }, + plugins: [ //new BundleAnalyzerPlugin(), - new rspack.IgnorePlugin({ - resourceRegExp: /osx-temperature-sensor/, - }), + // new rspack.IgnorePlugin({ + // resourceRegExp: /osx-temperature-sensor/, + // }), new rspack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), - new CopyWebpackPlugin({ + new rspack.CopyRspackPlugin({ patterns: [ { from: cMapsDir, to: './cmaps/' }, ], diff --git a/rspack.node.config.js b/rspack.node.config.js index 8e543af99a..2ea88fd4eb 100644 --- a/rspack.node.config.js +++ b/rspack.node.config.js @@ -27,5 +27,7 @@ module.exports = (env) => { resourceRegExp: /osx-temperature-sensor/, }), ], + + stats: 'detailed', }; }; \ No newline at end of file