Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/content/guides/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ As of version 4, webpack doesn't require any configuration, but most projects wi

```javascript
import path from 'path';
import { fileURLToPath } from 'url';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes the config duplicate, sorry but this change is not needed. Feel free to remove the first export and keep the __dirname logic.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification!
I’ve removed the first export and kept the __dirname logic only.


const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

export default {
entry: './src/index.js',
Expand All @@ -259,6 +263,7 @@ export default {
path: path.resolve(__dirname, 'dist'),
},
};

```

Now, let's run the build again but instead using our new configuration file:
Expand Down
Loading