Skip to content

Commit 99d8b80

Browse files
refactor: nodejs v10 dropped (#249)
BREAKING CHANGE: minimum supported `Node.js` version is `12.13.0`
1 parent 38851ea commit 99d8b80

19 files changed

Lines changed: 2483 additions & 2591 deletions

.github/workflows/nodejs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
with:
3030
fetch-depth: 0
3131

32-
- name: Use Node.js ${{ env.node-version }}
32+
- name: Use Node.js ${{ matrix.node-version }}
3333
uses: actions/setup-node@v1
3434
with:
35-
node-version: ${{ env.node-version }}
35+
node-version: ${{ matrix.node-version }}
3636

3737
- name: Use latest NPM
3838
run: sudo npm i -g npm
@@ -55,7 +55,7 @@ jobs:
5555
strategy:
5656
matrix:
5757
os: [ubuntu-latest, windows-latest, macos-latest]
58-
node-version: [10.x, 12.x, 14.x]
58+
node-version: [12.x, 14.x, 16.x]
5959
webpack-version: [latest]
6060

6161
runs-on: ${{ matrix.os }}

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit $1

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install lint-staged

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = (api) => {
1010
"@babel/preset-env",
1111
{
1212
targets: {
13-
node: "10.13.0",
13+
node: "12.13.0",
1414
},
1515
},
1616
],

husky.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

package-lock.json

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

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"main": "dist/cjs.js",
1515
"engines": {
16-
"node": ">= 10.13.0"
16+
"node": ">= 12.13.0"
1717
},
1818
"scripts": {
1919
"start": "npm run build -- -w",
@@ -30,7 +30,7 @@
3030
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
3131
"pretest": "npm run lint",
3232
"test": "npm run test:coverage",
33-
"prepare": "npm run build",
33+
"prepare": "husky install && npm run build",
3434
"release": "standard-version"
3535
},
3636
"files": [
@@ -44,31 +44,31 @@
4444
"serialize-javascript": "^5.0.1"
4545
},
4646
"devDependencies": {
47-
"@babel/cli": "^7.13.14",
48-
"@babel/core": "^7.13.14",
49-
"@babel/preset-env": "^7.13.12",
50-
"@commitlint/cli": "^12.0.1",
51-
"@commitlint/config-conventional": "^12.0.1",
47+
"@babel/cli": "^7.14.3",
48+
"@babel/core": "^7.14.3",
49+
"@babel/preset-env": "^7.14.2",
50+
"@commitlint/cli": "^12.1.4",
51+
"@commitlint/config-conventional": "^12.1.4",
5252
"@gfx/zopfli": "^1.0.15",
5353
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
5454
"babel-jest": "^26.6.3",
5555
"cross-env": "^7.0.3",
5656
"del": "^6.0.0",
5757
"del-cli": "^3.0.1",
58-
"eslint": "^7.23.0",
59-
"eslint-config-prettier": "^8.1.0",
60-
"eslint-plugin-import": "^2.22.1",
58+
"eslint": "^7.26.0",
59+
"eslint-config-prettier": "^8.3.0",
60+
"eslint-plugin-import": "^2.23.2",
6161
"file-loader": "^6.2.0",
62-
"husky": "^4.3.7",
62+
"husky": "^6.0.0",
6363
"jest": "^26.6.3",
64-
"lint-staged": "^10.5.4",
65-
"memfs": "^3.2.1",
64+
"lint-staged": "^11.0.0",
65+
"memfs": "^3.2.2",
6666
"npm-run-all": "^4.1.5",
67-
"prettier": "^2.2.1",
68-
"standard-version": "^9.1.1",
69-
"webpack": "^5.29.0",
67+
"prettier": "^2.3.0",
68+
"standard-version": "^9.3.0",
69+
"webpack": "^5.37.1",
7070
"webpack-stats-plugin": "^1.0.3",
71-
"workbox-webpack-plugin": "^6.0.2"
71+
"workbox-webpack-plugin": "^6.1.5"
7272
},
7373
"keywords": [
7474
"webpack"

src/index.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,8 @@ class CompressionPlugin {
202202
for (const asset of assetsForMinify) {
203203
scheduledTasks.push(
204204
(async () => {
205-
const {
206-
name,
207-
source,
208-
buffer,
209-
output,
210-
cacheItem,
211-
info,
212-
relatedName,
213-
} = asset;
205+
const { name, source, buffer, output, cacheItem, info, relatedName } =
206+
asset;
214207

215208
if (!output.source) {
216209
if (!output.compressed) {

0 commit comments

Comments
 (0)