From 1d5cdc25c6a51ac41ea71fc94b6d3c72f062a321 Mon Sep 17 00:00:00 2001 From: Abir Maity Date: Wed, 11 Mar 2026 19:19:41 +0530 Subject: [PATCH] docs(plugins): convert EnvironmentPlugin git example to ESM --- src/content/plugins/environment-plugin.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/plugins/environment-plugin.mdx b/src/content/plugins/environment-plugin.mdx index fa2cb2508fbe..160fb7089da1 100644 --- a/src/content/plugins/environment-plugin.mdx +++ b/src/content/plugins/environment-plugin.mdx @@ -94,10 +94,10 @@ if ("false") { The following `EnvironmentPlugin` configuration provides `process.env.GIT_VERSION` (such as "v5.4.0-2-g25139f57f") and `process.env.GIT_AUTHOR_DATE` (such as "2020-11-04T12:25:16+01:00") corresponding to the last Git commit of the repository: ```javascript -const child_process = require("node:child_process"); +import childProcess from "node:child_process"; function git(command) { - return child_process.execSync(`git ${command}`, { encoding: "utf8" }).trim(); + return childProcess.execSync(`git ${command}`, { encoding: "utf8" }).trim(); } new webpack.EnvironmentPlugin({