diff --git a/docs/hooks/overview.mdx b/docs/hooks/overview.mdx index b0d4585fe5..807d5520ad 100644 --- a/docs/hooks/overview.mdx +++ b/docs/hooks/overview.mdx @@ -36,7 +36,7 @@ If your Hook simply performs a side-effect, such as updating a CRM, it might be #### Server-only execution -Payload Hooks are only triggered on the server. You can safely [remove your hooks](/docs/admin/webpack#aliasing-server-only-modules) from your Admin panel's client-side code by customizing the Webpack config, which not only keeps your Admin bundles' filesize small but also ensures that any server-side only code does not cause problems within browser environments. +Payload Hooks are only triggered on the server. You can safely [remove your hooks](/docs/admin/excluding-server-code#aliasing-server-only-modules) from your Admin panel's client-side code by customizing the Webpack config, which not only keeps your Admin bundles' filesize small but also ensures that any server-side only code does not cause problems within browser environments. ## Hook Types diff --git a/docs/plugins/build-your-own.mdx b/docs/plugins/build-your-own.mdx index 0b6970112c..271e8a4980 100644 --- a/docs/plugins/build-your-own.mdx +++ b/docs/plugins/build-your-own.mdx @@ -247,7 +247,7 @@ In the template, we have stubbed out a basic `onInitExtension` file that you can ### Webpack -If any of your files use server only packages such as fs, stripe, nodemailer, etc, they will need to be removed from the browser bundle. To do that, you can [alias the file imports with webpack](https://payloadcms.com/docs/admin/webpack#aliasing-server-only-modules). +If any of your files use server only packages such as fs, stripe, nodemailer, etc, they will need to be removed from the browser bundle. To do that, you can [alias the file imports with webpack](https://payloadcms.com/docs/admin/excluding-server-code#aliasing-server-only-modules). When files are bundled for the browser, the import paths are essentially crawled to determine what files to include in the bundle. To prevent the server only files from making it into the bundle, we can alias their import paths to a file that can be included in the browser. This will short-circuit the import path crawling and ensure browser only code is bundled.