From 2f90c74c70538498f8b18e405c071fa71e3c1c89 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Tue, 11 Jun 2024 07:58:44 +0100 Subject: [PATCH] feat: drop mkdirp (#1743) Removes `mkdirp` and uses the built in `recursive` flag node provides (since 10.x). --- package.json | 1 - src/license-plugin.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 2e9c34ee..c75919dd 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "glob": "~7.2.0", "lodash": "~4.17.21", "magic-string": "~0.30.0", - "mkdirp": "~3.0.0", "moment": "~2.30.1", "package-name-regex": "~2.0.6", "spdx-expression-validate": "~2.0.0", diff --git a/src/license-plugin.js b/src/license-plugin.js index a6fd40e1..4e081583 100644 --- a/src/license-plugin.js +++ b/src/license-plugin.js @@ -24,7 +24,6 @@ import fs from 'fs'; import path from 'path'; -import { mkdirp } from 'mkdirp'; import _ from 'lodash'; import moment from 'moment'; import MagicString from 'magic-string'; @@ -588,7 +587,7 @@ class LicensePlugin { this.debug(`use encoding: ${encoding}`); // Create directory if it does not already exist. - mkdirp.sync(path.parse(file).dir); + fs.mkdirSync(path.parse(file).dir, { recursive: true }); fs.writeFileSync(file, (text || '').trim(), { encoding,