Skip to content

Commit d0b49b4

Browse files
authored
docs: fix webpack.config.js example for ESM and CommonJS (#7735)
* docs: fix webpack.config.js example for ESM and CommonJS * docs: fix markdown lint (MD031 blanks around fences) * docs: restore ESM example and move __dirname logic below import * docs: restore ESM example and move __dirname logic below import * docs: restore original string literal formatting * docs: quotes correction
1 parent 2b6f46d commit d0b49b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/content/guides/getting-started.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ As of version 4, webpack doesn't require any configuration, but most projects wi
251251

252252
```javascript
253253
import path from 'path';
254+
import { fileURLToPath } from 'url';
255+
256+
const __filename = fileURLToPath(import.meta.url);
257+
const __dirname = path.dirname(__filename);
254258

255259
export default {
256260
entry: './src/index.js',

0 commit comments

Comments
 (0)