File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ contributors:
1919 - rahul3v
2020 - snitin315
2121 - vansh5632
22+ - Brennvo
2223related :
2324 - title : Debugging Optimization Bailouts
2425 url : https://webpack.js.org/plugins/module-concatenation-plugin/#debugging-optimization-bailouts
@@ -69,9 +70,13 @@ Set the `mode` configuration option to [development](/configuration/mode/#mode-d
6970** webpack.config.js**
7071
7172``` diff
72- const path = require('path');
73+ import path from 'node:path';
74+ import { fileURLToPath } from 'node:url';
7375
74- module.exports = {
76+ const __filename = fileURLToPath(import.meta.url);
77+ const __dirname = path.dirname(__filename);
78+
79+ export default {
7580 entry: './src/index.js',
7681 output: {
7782 filename: 'bundle.js',
@@ -517,9 +522,13 @@ So we've cued up our "dead code" to be dropped by using the `import` and `export
517522** webpack.config.js**
518523
519524``` diff
520- const path = require('path');
525+ import path from 'node:path';
526+ import { fileURLToPath } from 'node:url';
527+
528+ const __filename = fileURLToPath(import.meta.url);
529+ const __dirname = path.dirname(__filename);
521530
522- module.exports = {
531+ export default {
523532 entry: './src/index.js',
524533 output: {
525534 filename: 'bundle.js',
You can’t perform that action at this time.
0 commit comments