webpack dev server 1

webpack dev server

 devServer: {
    contentBase: path.join(__dirname, 'dist'),
    compress: true,
    port: 9000,
  },
 // on package json file..
 "start": "./node_modules/.bin/webpack serve",

Here is what the above code is Doing:
1. We are telling webpack to use the webpack-dev-server package.
2. We are telling webpack to serve our application from the dist folder.
3. We are telling webpack to compress the output.
4. We are telling webpack to serve our application on port 9000.
5. We are telling webpack to use the webpack-dev-server package to serve our application.

Similar Posts