# Preferred way to exclude pages from including a script

**URL:** https://discourse.roots.io/t/preferred-way-to-exclude-pages-from-including-a-script/26934
**Category:** sage
**Created:** 2024-04-03T16:42:21Z
**Posts:** 2
**Showing post:** 2 of 2

## Post 2 by @ben — 2024-04-03T18:32:42Z

Use dynamic imports. Take a look at these:

- [How to add Javascript the right way in Sage10 - #2 by csorrentino](https://discourse.roots.io/t/how-to-add-javascript-the-right-way-in-sage10/25047/2)
- [https://bud.js.org/learn/modules/js-modules#dynamic-imports](https://bud.js.org/learn/modules/js-modules#dynamic-imports)

---

_[View the full topic](https://discourse.roots.io/t/preferred-way-to-exclude-pages-from-including-a-script/26934)._
