@@ -40,9 +40,9 @@ This set of options is picked up by [webpack-dev-server](https://github.com/webp
4040** webpack.config.js**
4141
4242``` javascript
43- const path = require ( " node:path" ) ;
43+ import path from " node:path" ;
4444
45- module . exports = {
45+ export default {
4646 // ...
4747 devServer: {
4848 static: {
@@ -876,9 +876,9 @@ You can also listen to a different socket with:
876876** webpack.config.js**
877877
878878``` javascript
879- const path = require ( " node:path" ) ;
879+ import path from " node:path" ;
880880
881- module . exports = {
881+ export default {
882882 // ...
883883 devServer: {
884884 ipc: path .join (__dirname , " my-socket.sock" ),
@@ -1351,10 +1351,10 @@ It also allows you to set additional [TLS options](https://nodejs.org/api/tls.ht
13511351** webpack.config.js**
13521352
13531353``` javascript
1354- const fs = require ( " node:fs" ) ;
1355- const path = require ( " node:path" ) ;
1354+ import fs from " node:fs" ;
1355+ import path from " node:path" ;
13561356
1357- module . exports = {
1357+ export default {
13581358 // ...
13591359 devServer: {
13601360 server: {
@@ -1521,9 +1521,9 @@ Tell the server where to serve the content from. This is only necessary if you w
15211521** webpack.config.js**
15221522
15231523``` javascript
1524- const path = require ( " node:path" ) ;
1524+ import path from " node:path" ;
15251525
1526- module . exports = {
1526+ export default {
15271527 // ...
15281528 devServer: {
15291529 static: {
@@ -1538,9 +1538,9 @@ Provide an array of objects in case you have multiple static folders:
15381538** webpack.config.js**
15391539
15401540``` javascript
1541- const path = require ( " node:path" ) ;
1541+ import path from " node:path" ;
15421542
1543- module . exports = {
1543+ export default {
15441544 // ...
15451545 devServer: {
15461546 static: [
@@ -1587,9 +1587,9 @@ Tell the server at which URL to serve [`static.directory`](#directory) content.
15871587** webpack.config.js**
15881588
15891589``` javascript
1590- const path = require ( " node:path" ) ;
1590+ import path from " node:path" ;
15911591
1592- module . exports = {
1592+ export default {
15931593 // ...
15941594 devServer: {
15951595 static: {
@@ -1605,9 +1605,9 @@ Provide an array of objects in case you have multiple static folders:
16051605** webpack.config.js**
16061606
16071607``` javascript
1608- const path = require ( " node:path" ) ;
1608+ import path from " node:path" ;
16091609
1610- module . exports = {
1610+ export default {
16111611 // ...
16121612 devServer: {
16131613 static: [
@@ -1635,9 +1635,9 @@ Tell dev-server to use [`serveIndex`](https://github.com/expressjs/serve-index)
16351635** webpack.config.js**
16361636
16371637``` javascript
1638- const path = require ( " node:path" ) ;
1638+ import path from " node:path" ;
16391639
1640- module . exports = {
1640+ export default {
16411641 // ...
16421642 devServer: {
16431643 static: {
@@ -1669,9 +1669,9 @@ Tell dev-server to watch the files served by the [`static.directory`](#directory
16691669** webpack.config.js**
16701670
16711671``` javascript
1672- const path = require ( " node:path" ) ;
1672+ import path from " node:path" ;
16731673
1674- module . exports = {
1674+ export default {
16751675 // ...
16761676 devServer: {
16771677 static: {
@@ -1699,9 +1699,9 @@ It is possible to configure advanced options for watching static files from [`st
16991699** webpack.config.js**
17001700
17011701``` javascript
1702- const path = require ( " node:path" ) ;
1702+ import path from " node:path" ;
17031703
1704- module . exports = {
1704+ export default {
17051705 // ...
17061706 devServer: {
17071707 static: {
0 commit comments