Skip to content

Commit

Permalink
Document strapi/strapi #19647 (watch-admin by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwizla committed Mar 4, 2024
1 parent 52498c8 commit d1e8a13
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
12 changes: 6 additions & 6 deletions docusaurus/docs/dev-docs/admin-panel-customization.md
Expand Up @@ -20,7 +20,7 @@ To start your strapi instance with hot reloading while developing, run the follo

```bash
cd my-app # cd into the root directory of the Strapi application project
strapi develop --watch-admin
strapi develop
```

## Customization options
Expand Down Expand Up @@ -100,8 +100,8 @@ module.exports = ({ env }) => ({

```js title="./config/admin.js"
module.exports = ({ env }) => ({
host: "my-host", // only used along with `strapi develop --watch-admin` command
port: 3000, // only used along with `strapi develop --watch-admin` command
host: "my-host",
port: 3000,
});
```

Expand All @@ -118,8 +118,8 @@ export default ({ env }) => ({

```js title="./config/admin.ts"
export default ({ env }) => ({
host: "my-host", // only used along with `strapi develop --watch-admin` command
port: 3000, // only used along with `strapi develop --watch-admin` command
host: "my-host",
port: 3000,
});
```

Expand Down Expand Up @@ -599,7 +599,7 @@ This is considered experimental. Please report any issues you encounter.
To use `vite` as a bundler you will need to pass it as an option to the `strapi develop` command:

```bash
strapi develop --watch-admin --bundler=vite
strapi develop --bundler=vite
```

To extend the usage of `vite`, define a function that extends its configuration inside `./my-app/src/admin/vite.config.[js|ts]`:
Expand Down
12 changes: 6 additions & 6 deletions docusaurus/docs/dev-docs/configurations/admin-panel.md
Expand Up @@ -35,8 +35,8 @@ The `./config/admin.js` file can include the following parameters:
| `url` | Url of your admin panel. Default value: `/admin`. Note: If the url is relative, it will be concatenated with `url`. | string | `/admin` |
| `autoOpen` | Enable or disable administration opening on start. | boolean | `true` |
| `watchIgnoreFiles` | Add custom files that should not be watched during development. See more [here](https://github.com/paulmillr/chokidar#path-filtering) (property `ignored`). | array(string) | `[]` |
| `host` | Use a different host for the admin panel. Only used along with `strapi develop --watch-admin` | string | `localhost` |
| `port` | Use a different port for the admin panel. Only used along with `strapi develop --watch-admin` | string | `8000` |
| `host` | Use a different host for the admin panel. | string | `localhost` |
| `port` | Use a different port for the admin panel. | string | `8000` |
| `serveAdminPanel` | If false, the admin panel won't be served. Note: the `index.html` will still be served, see [defaultIndex option](/dev-docs/configurations/middlewares) | boolean | `true` |
| `forgotPassword` | Settings to customize the forgot password email (see [Forgot Password Email](/dev-docs/admin-panel-customization#forgotten-password-email)) | object | {} |
| `forgotPassword.emailTemplate` | Email template as defined in [email plugin](/dev-docs/plugins/email#using-the-sendtemplatedemail-function) | object | [Default template](https://github.com/strapi/strapi/blob/main/packages/core/admin/server/config/email-templates/forgot-password.js) |
Expand Down Expand Up @@ -160,8 +160,8 @@ module.exports = ({ env }) => ({
'./my-custom-folder', // Folder
'./scripts/someScript.sh', // File
],
host: 'localhost', // Only used for --watch-admin
port: 8003, // Only used for --watch-admin
host: 'localhost',
port: 8003,
serveAdminPanel: env.bool('SERVE_ADMIN', true),
forgotPassword: {
from: 'no-reply@example.com',
Expand Down Expand Up @@ -215,8 +215,8 @@ export default ({ env }) => ({
'./my-custom-folder', // Folder
'./scripts/someScript.sh', // File
],
host: 'localhost', // Only used for --watch-admin
port: 8003, // Only used for --watch-admin
host: 'localhost',
port: 8003,
serveAdminPanel: env.bool('SERVE_ADMIN', true),
forgotPassword: {
from: 'no-reply@example.com',
Expand Down
4 changes: 0 additions & 4 deletions docusaurus/docs/dev-docs/plugins-development.md
Expand Up @@ -64,10 +64,6 @@ Strapi provides a [command line interface (CLI)](/dev-docs/cli) for creating plu

Plugins created using the preceding directions are located in the `plugins` directory of the application (see [project structure](/dev-docs/project-structure)).

:::note
During plugin development it is helpful to use the `--watch-admin` flag to toggle hot reloading of the admin panel. See the [Admin panel customization](/dev-docs/admin-panel-customization) documentation for more details. (TypeScript specific) While developing your plugin, you can run `yarn develop --watch-admin` or `npm run develop -- --watch-admin` in the plugin directory to watch the changes to the TypeScript server files.
:::

:::tip
Check [this blog post](https://strapi.io/blog/how-to-create-a-strapi-v4-plugin-publish-on-npm-6-6) to learn how to publish your Strapi plugin on npm.
:::
Expand Down
Expand Up @@ -293,15 +293,15 @@ If you are doing development on both the `/server` and `/admin` directories of y
<TabItem value="yarn" label="Yarn">

```bash
yarn develop --watch-admin
yarn develop
```

</TabItem>

<TabItem value="npm" label="NPM">

```bash
npm run develop -- --watch-admin
npm run develop
```

</TabItem>
Expand Down

1 comment on commit d1e8a13

@joshuaellis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have --no-watch-admin to turn it off by the way oh & vite is the default bundler in V5.

Please sign in to comment.