Skip to content

Commit 3c4c526

Browse files
ItsAbir005pranjalisr
authored andcommitted
docs(migrate): convert CJS config examples to ESM (webpack#7981)
1 parent ae1e0a2 commit 3c4c526

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/content/migrate/5.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ T> Checkout the detailed changes in the configuration options [here](/blog/2020-
9898
Try to set the following options in your webpack 4 configuration and check if build still works correctly.
9999

100100
```javascript
101-
module.exports = {
101+
export default {
102102
// ...
103103
node: {
104104
Buffer: false,

src/content/plugins/environment-plugin.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ if ("false") {
9494
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:
9595

9696
```javascript
97-
const child_process = require("node:child_process");
97+
import childProcess from "node:child_process";
9898

9999
function git(command) {
100-
return child_process.execSync(`git ${command}`, { encoding: "utf8" }).trim();
100+
return childProcess.execSync(`git ${command}`, { encoding: "utf8" }).trim();
101101
}
102102

103103
new webpack.EnvironmentPlugin({

0 commit comments

Comments
 (0)