Skip to content

Commit 18e8efa

Browse files
rauno56vmarchaud
andauthored
feat: update webpack outside of examples (open-telemetry#963)
* feat: update webpack outside of examples * chore: replace istanbul-instrumenter-loader with @jsdevtools/coverage-istanbul-loader Co-authored-by: Valentin Marchaud <[email protected]>
1 parent f32ee41 commit 18e8efa

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

karma.conf.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright 2020, OpenTelemetry Authors
2+
* Copyright The OpenTelemetry Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,10 +14,29 @@
1414
* limitations under the License.
1515
*/
1616

17+
const webpack = require('webpack');
18+
1719
const karmaWebpackConfig = require('../../karma.webpack');
1820
const karmaBaseConfig = require('../../karma.base');
1921

2022
module.exports = (config) => {
23+
{
24+
const plugins = karmaWebpackConfig.plugins = [];
25+
plugins.push(new webpack.ProvidePlugin({
26+
process: 'process/browser',
27+
}));
28+
}
29+
30+
{
31+
const plugins = karmaBaseConfig.plugins = [];
32+
const toAdd = Object.keys(require('./package.json').devDependencies)
33+
.filter((packageName) => packageName.startsWith('karma-'))
34+
.map((packageName) => require(packageName));
35+
plugins.push(
36+
...toAdd
37+
);
38+
}
39+
2140
config.set(Object.assign({}, karmaBaseConfig, {
2241
webpack: karmaWebpackConfig
2342
}))

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,28 @@
4848
"@opentelemetry/api": "^1.0.2"
4949
},
5050
"devDependencies": {
51+
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
5152
"@opentelemetry/api": "1.0.2",
5253
"@types/mocha": "8.2.3",
5354
"@types/node": "16.11.21",
5455
"@types/webpack-env": "1.16.2",
56+
"assert": "2.0.0",
5557
"gts": "3.1.0",
56-
"istanbul-instrumenter-loader": "3.0.1",
57-
"karma": "6.3.16",
58-
"karma-chrome-launcher": "3.1.0",
58+
"karma": "6.3.17",
59+
"karma-chrome-launcher": "3.1.1",
5960
"karma-coverage-istanbul-reporter": "3.0.3",
6061
"karma-mocha": "2.0.1",
61-
"karma-spec-reporter": "0.0.32",
62-
"karma-webpack": "4.0.2",
62+
"karma-spec-reporter": "0.0.33",
63+
"karma-webpack": "5.0.0",
6364
"mocha": "7.2.0",
6465
"nyc": "15.1.0",
66+
"process": "0.11.10",
6567
"rimraf": "3.0.2",
6668
"ts-loader": "8.3.0",
6769
"ts-mocha": "8.0.0",
6870
"typescript": "4.3.5",
69-
"webpack": "4.46.0"
71+
"webpack": "5.72.0",
72+
"webpack-cli": "4.9.2"
7073
},
7174
"dependencies": {
7275
"@opentelemetry/core": "^1.0.0"

0 commit comments

Comments
 (0)