Skip to content

Commit

Permalink
feat: drop support for webpack 4
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Only webpack 5 is supported.
  • Loading branch information
danez committed Jul 26, 2023
1 parent 1b07b76 commit 34da2e9
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 19 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ jobs:
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
webpack-version: [default, ^4.0.0]
exclude:
- node-version: 18.x
webpack-version: ^4.0.0

steps:
- name: Checkout
Expand All @@ -42,10 +38,6 @@ jobs:
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
run: yarn install --frozen-lockfile --non-interactive

- name: Install webpack
if: ${{ matrix.webpack-version != 'default' }}
run: yarn add --dev webpack@${{ matrix.webpack-version }}

- name: Unit tests
run: yarn test --ci

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

<h2 align="center">Requirements</h2>

- Version 5 of `grunt-webpack` supports webpack version 4 and 5 and (optional) `webpack-dev-server` version 4.
- Version 6 of `grunt-webpack` supports webpack 5 and (optional) `webpack-dev-server` version 4.
- For webpack 4 use version 5 of `grunt-webpack`

<h2 align="center">Install</h2>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"tasks"
],
"peerDependencies": {
"webpack": "^4.0.0 || ^5.0.0"
"webpack": "^5.0.0"
},
"license": "MIT",
"keywords": [
Expand Down
10 changes: 1 addition & 9 deletions src/plugins/CachePluginFactory.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
"use strict";

let CachePlugin;
try {
// webpack 5
CachePlugin = require("webpack/lib/cache/MemoryCachePlugin");
} catch (e) {
// webpack 4
// eslint-disable-next-line import/no-unresolved,import/extensions
CachePlugin = require("webpack/lib/CachePlugin");
}
const CachePlugin = require("webpack/lib/cache/MemoryCachePlugin");

class CachePluginFactory {
constructor() {
Expand Down

0 comments on commit 34da2e9

Please sign in to comment.