Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(guides): auto reload fixed in Development #6063

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/content/guides/development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ contributors:
- chenxsan
- maxloh
- snitin315
- avishek143
---

T> This guide extends on code examples found in the [Output Management](/guides/output-management) guide.
Expand Down Expand Up @@ -214,6 +215,7 @@ Change your configuration file to tell the dev server where to look for files:
devtool: 'inline-source-map',
+ devServer: {
+ static: './dist',
+ watchFiles: ['./src/**/*.*'],
+ },
plugins: [
new HtmlWebpackPlugin({
Expand All @@ -228,7 +230,7 @@ Change your configuration file to tell the dev server where to look for files:
};
```

This tells `webpack-dev-server` to serve the files from the `dist` directory on `localhost:8080`.
This tells `webpack-dev-server` to serve the files from the `dist` directory on `localhost:8080` and refresh the browser with the new content when any source file inside the `./src` folder changes.

T> `webpack-dev-server` serves bundled files from the directory defined in [`output.path`](/configuration/output/#outputpath), i.e., files will be available under `http://[devServer.host]:[devServer.port]/[output.publicPath]/[output.filename]`.

Expand Down