Skip to content

Commit

Permalink
ref: Remove references to Webpack 4 (#43)
Browse files Browse the repository at this point in the history
As we currently only support Node 18+, we currently cannot support Webpack 4.
  • Loading branch information
nicholas-codecov authored Jan 4, 2024
1 parent 48b6e90 commit 4f1183e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .changeset/flat-coats-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@codecov/webpack-plugin": patch
"@codecov/bundler-plugin-core": patch
"@codecov/rollup-plugin": patch
"@codecov/vite-plugin": patch
---

Remove references to Webpack 4, as we currently on support Node 18+.
8 changes: 4 additions & 4 deletions packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
"test:unit:ci": "jest --coverage"
},
"dependencies": {
"@codecov/bundler-plugin-core": "workspace:^",
"webpack": "5.89.0"
"@codecov/bundler-plugin-core": "workspace:^"
},
"devDependencies": {
"@swc/core": "^1.3.99",
Expand All @@ -55,10 +54,11 @@
"msw": "^2.0.9",
"ts-node": "^10.9.1",
"typescript": "^5.3.2",
"unbuild": "^2.0.0"
"unbuild": "^2.0.0",
"webpack": "^5.89.0"
},
"peerDependencies": {
"webpack": "^5.0"
"webpack": "webpack@^5.0"
},
"volta": {
"extends": "../../package.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
normalizePath,
type BundleAnalysisUploadPlugin,
} from "@codecov/bundler-plugin-core";
import * as webpack4or5 from "webpack";
import * as webpack from "webpack";

import { findFilenameFormat } from "./findFileFormat";

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

output.bundler = {
name: "webpack",
version: webpack4or5.version,
version: webpack.version,
};

const outputOptions = compilation.outputOptions;
Expand Down Expand Up @@ -131,7 +132,7 @@ export const webpackBundleAnalysisPlugin: BundleAnalysisUploadPlugin = ({

// only output file if running dry run
if (userOptions?.dryRun) {
const { RawSource } = webpack4or5.sources;
const { RawSource } = webpack.sources;
compilation.emitAsset(
"codecov-bundle-stats.json",
new RawSource(JSON.stringify(output)),
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f1183e

Please sign in to comment.