Skip to content

Commit

Permalink
docs: warn about modules with side-effects (#19592)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien committed Mar 11, 2023
1 parent b19b35f commit 4163bb8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/2.guide/1.concepts/3.rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Universal rendering allows a Nuxt application to provide quick page load times w
For more examples about writing Vue code without hydration mismatch, see [the Vue docs](https://vuejs.org/guide/scaling-up/ssr.html#hydration-mismatch).
::

::alert{type=warning}
When importing a library that relies on browser APIs and has side effects, make sure the component importing it is only called client-side. Bundlers do not treeshake imports of modules containing side effects.
::

### Examples

Universal rendering is very versatile and can fit almost any use case, and is especially appropriate for any content-oriented websites: **blogs, marketing websites, portfolios, e-commerce sites, and marketplaces.**
Expand Down

0 comments on commit 4163bb8

Please sign in to comment.