Skip to content

Commit 4f1183e

Browse files
authored
ref: Remove references to Webpack 4 (#43)
As we currently only support Node 18+, we currently cannot support Webpack 4.
1 parent 48b6e90 commit 4f1183e

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.changeset/flat-coats-jump.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@codecov/webpack-plugin": patch
3+
"@codecov/bundler-plugin-core": patch
4+
"@codecov/rollup-plugin": patch
5+
"@codecov/vite-plugin": patch
6+
---
7+
8+
Remove references to Webpack 4, as we currently on support Node 18+.

packages/webpack-plugin/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
"test:unit:ci": "jest --coverage"
4343
},
4444
"dependencies": {
45-
"@codecov/bundler-plugin-core": "workspace:^",
46-
"webpack": "5.89.0"
45+
"@codecov/bundler-plugin-core": "workspace:^"
4746
},
4847
"devDependencies": {
4948
"@swc/core": "^1.3.99",
@@ -55,10 +54,11 @@
5554
"msw": "^2.0.9",
5655
"ts-node": "^10.9.1",
5756
"typescript": "^5.3.2",
58-
"unbuild": "^2.0.0"
57+
"unbuild": "^2.0.0",
58+
"webpack": "^5.89.0"
5959
},
6060
"peerDependencies": {
61-
"webpack": "^5.0"
61+
"webpack": "webpack@^5.0"
6262
},
6363
"volta": {
6464
"extends": "../../package.json"

packages/webpack-plugin/src/webpack-bundle-analysis/webpackBundleAnalysisPlugin.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
normalizePath,
44
type BundleAnalysisUploadPlugin,
55
} from "@codecov/bundler-plugin-core";
6-
import * as webpack4or5 from "webpack";
6+
import * as webpack from "webpack";
7+
78
import { findFilenameFormat } from "./findFileFormat";
89

910
const PLUGIN_NAME = "codecov-webpack-bundle-analysis-plugin";
@@ -20,7 +21,7 @@ export const webpackBundleAnalysisPlugin: BundleAnalysisUploadPlugin = ({
2021
compilation.hooks.processAssets.tap(
2122
{
2223
name: PLUGIN_NAME,
23-
stage: webpack4or5.Compilation.PROCESS_ASSETS_STAGE_REPORT,
24+
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT,
2425
},
2526
() => {
2627
// don't need to do anything if the bundle name is not present or empty
@@ -47,7 +48,7 @@ export const webpackBundleAnalysisPlugin: BundleAnalysisUploadPlugin = ({
4748

4849
output.bundler = {
4950
name: "webpack",
50-
version: webpack4or5.version,
51+
version: webpack.version,
5152
};
5253

5354
const outputOptions = compilation.outputOptions;
@@ -131,7 +132,7 @@ export const webpackBundleAnalysisPlugin: BundleAnalysisUploadPlugin = ({
131132

132133
// only output file if running dry run
133134
if (userOptions?.dryRun) {
134-
const { RawSource } = webpack4or5.sources;
135+
const { RawSource } = webpack.sources;
135136
compilation.emitAsset(
136137
"codecov-bundle-stats.json",
137138
new RawSource(JSON.stringify(output)),

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)