Skip to content

Commit aa4fa53

Browse files
fix(docs): use run-script-webpack-plugin in hot-reload
start-server-webpack-plugin doesn't work for webpack 5 ericclemmons/start-server-webpack-plugin#40
1 parent e648f71 commit aa4fa53

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

content/recipes/hot-reload.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you are using the [Nest CLI](https://docs.nestjs.com/cli/overview), the confi
1313
First install the required packages:
1414

1515
```bash
16-
$ npm i --save-dev webpack-node-externals start-server-webpack-plugin
16+
$ npm i --save-dev webpack-node-externals run-script-webpack-plugin
1717
```
1818

1919
#### Configuration
@@ -23,7 +23,7 @@ Once the installation is complete, create a `webpack-hmr.config.js` file in the
2323
```typescript
2424
const webpack = require('webpack');
2525
const nodeExternals = require('webpack-node-externals');
26-
const StartServerPlugin = require('start-server-webpack-plugin');
26+
const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin');
2727

2828
module.exports = function(options) {
2929
return {
@@ -39,7 +39,7 @@ module.exports = function(options) {
3939
...options.plugins,
4040
new webpack.HotModuleReplacementPlugin(),
4141
new webpack.WatchIgnorePlugin([/\.js$/, /\.d\.ts$/]),
42-
new StartServerPlugin({ name: options.output.filename }),
42+
new RunScriptWebpackPlugin({ name: options.output.filename }),
4343
],
4444
};
4545
};
@@ -87,7 +87,7 @@ If you are not using the [Nest CLI](https://docs.nestjs.com/cli/overview), the c
8787
First install the required packages:
8888

8989
```bash
90-
$ npm i --save-dev webpack webpack-cli webpack-node-externals ts-loader start-server-webpack-plugin
90+
$ npm i --save-dev webpack webpack-cli webpack-node-externals ts-loader run-script-webpack-plugin
9191
```
9292

9393
#### Configuration
@@ -98,7 +98,7 @@ Once the installation is complete, create a `webpack.config.js` file in the root
9898
const webpack = require('webpack');
9999
const path = require('path');
100100
const nodeExternals = require('webpack-node-externals');
101-
const StartServerPlugin = require('start-server-webpack-plugin');
101+
const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin');
102102

103103
module.exports = {
104104
entry: ['webpack/hot/poll?100', './src/main.ts'],
@@ -124,7 +124,7 @@ module.exports = {
124124
},
125125
plugins: [
126126
new webpack.HotModuleReplacementPlugin(),
127-
new StartServerPlugin({ name: 'server.js' }),
127+
new RunScriptWebpackPlugin({ name: 'server.js' }),
128128
],
129129
output: {
130130
path: path.join(__dirname, 'dist'),

0 commit comments

Comments
 (0)