Skip to content

Commit 3b65590

Browse files
author
MargeBot
committed
Merge branch 'make-collect-metrics-optional' into 'main'
ci: make collect-metrics package optional See merge request web/clients!18844
2 parents b4dbdd0 + 7d910a0 commit 3b65590

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

packages/pack/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"@babel/preset-typescript": "^7.27.1",
2222
"@babel/runtime": "^7.28.3",
2323
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
24-
"@proton/collect-metrics": "workspace:^",
2524
"@sentry/webpack-plugin": "^1.21.0",
2625
"@swc/core": "^1.13.3",
2726
"autoprefixer": "^10.4.21",
@@ -66,6 +65,14 @@
6665
"prettier": "^3.6.2",
6766
"webpack-bundle-analyzer": "^4.10.2"
6867
},
68+
"peerDependencies": {
69+
"@proton/collect-metrics": "workspace:^"
70+
},
71+
"peerDependenciesMeta": {
72+
"@proton/collect-metrics": {
73+
"optional": true
74+
}
75+
},
6976
"engines": {
7077
"node": ">= 22.14.0"
7178
}

packages/pack/webpack/plugins.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const WriteWebpackPlugin = require('./write-webpack-plugin').default;
1616
const HtmlEditWebpackPlugin = require('./html-edit-webpack-plugin').default;
1717
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
1818
const SriWebpackPlugin = require('./sri-webpack-plugin').default;
19-
const { WebpackCollectMetricsPlugin } = require('@proton/collect-metrics');
2019

2120
const defaultFaviconConfig = require('./favicon.config');
2221
const faviconConfig = require(path.resolve('./favicon.config.js'));
@@ -39,6 +38,12 @@ module.exports = ({
3938
analyze,
4039
defineWebpackConfig,
4140
}) => {
41+
let WebpackCollectMetricsPlugin;
42+
43+
if (CI) {
44+
WebpackCollectMetricsPlugin = require('@proton/collect-metrics').WebpackCollectMetricsPlugin;
45+
}
46+
4247
return [
4348
...(isProduction
4449
? []

yarn.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8260,7 +8260,7 @@ __metadata:
82608260
languageName: unknown
82618261
linkType: soft
82628262

8263-
"@proton/collect-metrics@workspace:^, @proton/collect-metrics@workspace:utilities/collect-metrics":
8263+
"@proton/collect-metrics@workspace:utilities/collect-metrics":
82648264
version: 0.0.0-use.local
82658265
resolution: "@proton/collect-metrics@workspace:utilities/collect-metrics"
82668266
dependencies:
@@ -8863,7 +8863,6 @@ __metadata:
88638863
"@babel/preset-typescript": "npm:^7.27.1"
88648864
"@babel/runtime": "npm:^7.28.3"
88658865
"@pmmmwh/react-refresh-webpack-plugin": "npm:^0.6.1"
8866-
"@proton/collect-metrics": "workspace:^"
88678866
"@sentry/webpack-plugin": "npm:^1.21.0"
88688867
"@swc/core": "npm:^1.13.3"
88698868
autoprefixer: "npm:^10.4.21"
@@ -8905,6 +8904,11 @@ __metadata:
89058904
webpack-dev-server: "npm:^5.2.2"
89068905
webpack-retry-chunk-load-plugin: "npm:^3.1.1"
89078906
webpack-subresource-integrity: "npm:^5.1.0"
8907+
peerDependencies:
8908+
"@proton/collect-metrics": "workspace:^"
8909+
peerDependenciesMeta:
8910+
"@proton/collect-metrics":
8911+
optional: true
89088912
bin:
89098913
proton-pack: ./bin/protonPack.js
89108914
languageName: unknown

0 commit comments

Comments
 (0)