# How Does Sage 9 Enqueue jQuery?

**URL:** https://discourse.roots.io/t/how-does-sage-9-enqueue-jquery/11239
**Category:** sage
**Tags:** sage9
**Created:** 2018-01-04T15:56:19Z
**Posts:** 11
**Showing post:** 8 of 11

## Post 8 by @alwaysblank — 2018-01-04T23:31:13Z

In Sage’s webpack configuration, [jQuery is included under `externals`](https://github.com/roots/sage/blob/f6d8c9fd6ef08c2602962d6a52c8735d5344c0c6/resources/assets/build/webpack.config.js#L128).

Per [webpack’s documentation](https://webpack.js.org/configuration/externals/):

> The `externals` configuration option provides a way of excluding dependencies from the output bundles. Instead, the created bundle relies on that dependency to be present in the consumer’s environment.

In other words, webpack is told to not bundle up jQuery, but `import 'jquery'` in `main.js` makes the `jquery` object/variable available to other things in `main.js`.

---

_[View the full topic](https://discourse.roots.io/t/how-does-sage-9-enqueue-jquery/11239)._
