Skip to content

chore: bump webpack dependencies to 5.x #1486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions karma.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ module.exports = {
listenAddress: 'localhost',
hostname: 'localhost',
browsers: ['ChromeHeadless'],
frameworks: ['mocha'],
frameworks: ['mocha', 'webpack'],
coverageIstanbulReporter: {
reports: ['json'],
dir: '.nyc_output',
fixWebpackSourcePaths: true
},
reporters: ['spec', 'coverage-istanbul'],
files: ['test/index-webpack.ts'],
preprocessors: { 'test/index-webpack.ts': ['webpack'] },
webpackMiddleware: { noInfo: true }
preprocessors: { 'test/index-webpack.ts': ['webpack'] }
};
22 changes: 16 additions & 6 deletions karma.webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@
* limitations under the License.
*/

const webpackNodePolyfills = require('./webpack.node-polyfills.js');
const path = require('path');
const os = require('os');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');


// This is the webpack configuration for browser Karma tests with coverage.
module.exports = {
mode: 'development',
target: 'web',
output: { filename: 'bundle.js' },
output: {
filename: '[name].js',
path: path.join(os.tmpdir(), '_karma_22_webpack_') + Math.floor(Math.random() * 1000000) ,
},
resolve: { extensions: ['.ts', '.js', '.tsx'] },
devtool: 'inline-source-map',
module: {
Expand All @@ -37,10 +43,14 @@ module.exports = {
esModules: true
}
}
},
// This setting configures Node polyfills for the browser that will be
// added to the webpack bundle for Karma tests.
{ parser: { node: webpackNodePolyfills } }
}
]
},
plugins: [
new NodePolyfillPlugin()
],
optimization: {
runtimeChunk: false,
splitChunks: false
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"husky": "7.0.4",
"lerna": "5.5.2",
"lerna-changelog": "2.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"prettier": "2.8.7",
"typescript": "4.4.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"devDependencies": {
"@babel/core": "7.15.0",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/context-zone-peer-dep": "^1.8.0",
"@opentelemetry/instrumentation-xml-http-request": "^0.38.0",
Expand All @@ -57,31 +58,31 @@
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"@types/webpack-env": "1.16.2",
"babel-loader": "8.2.2",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"karma": "6.3.16",
"babel-loader": "9.1.2",
"karma": "6.4.2",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-jquery": "0.2.4",
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.32",
"karma-webpack": "4.0.2",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "5.0.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
"sinon": "15.0.1",
"ts-loader": "8.3.0",
"ts-loader": "9.4.2",
"ts-mocha": "10.0.0",
"typescript": "4.4.4",
"webpack": "4.46.0",
"webpack-cli": "4.7.2",
"webpack": "5.81.0",
"webpack-cli": "5.0.2",
"webpack-merge": "5.8.0",
"zone.js": "0.11.4"
},
"dependencies": {
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.38.0",
"@opentelemetry/sdk-trace-web": "^1.8.0"
"@opentelemetry/sdk-trace-web": "^1.8.0",
"node-polyfill-webpack-plugin": "^2.0.1"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0",
Expand Down