diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 48748e0..e7d51e8 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -56,7 +56,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [12.x, 14.x, 16.x] + node-version: [12.x, 14.x, 16.x, 17.x] webpack-version: [latest] runs-on: ${{ matrix.os }} diff --git a/test/CssMinimizerPlugin.test.js b/test/CssMinimizerPlugin.test.js index c545f0c..7f77f5e 100644 --- a/test/CssMinimizerPlugin.test.js +++ b/test/CssMinimizerPlugin.test.js @@ -1,5 +1,4 @@ import path from "path"; -import crypto from "crypto"; import { SourceMapConsumer } from "source-map"; import MiniCssExtractPlugin from "mini-css-extract-plugin"; @@ -456,8 +455,8 @@ describe("CssMinimizerPlugin", () => { for (const assetName of Object.keys(assets)) { const [, webpackHash] = assetName.match(/^.+?\.(.+?)\..+$/); const { hashDigestLength, hashDigest, hashFunction } = output; - const cryptoHash = crypto - .createHash(hashFunction) + const cryptoHash = require("webpack") + .util.createHash(hashFunction) .update(readAsset(assetName, compiler, stats)) .digest(hashDigest) .slice(0, hashDigestLength);