# @hotwired/stimulus-webpack-helpers

> Webpack helpers for Stimulus.

Latest version **1.0.1** (published 2021-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hotwired/stimulus-webpack-helpers
pnpm add @hotwired/stimulus-webpack-helpers
yarn add @hotwired/stimulus-webpack-helpers
bun add @hotwired/stimulus-webpack-helpers
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-09-24 |
| First published | 2021-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 35 |
| Author | Basecamp, LLC |
| Maintainers | javan, dhh |

## Links

- npm: https://www.npmjs.com/package/@hotwired/stimulus-webpack-helpers
- Repository: https://github.com/hotwired/stimulus-webpack-helpers
- Homepage: https://stimulus.hotwired.dev
- Issues: https://github.com/hotwired/stimulus-webpack-helpers/issues
- npm.io page: https://npm.io/package/@hotwired/stimulus-webpack-helpers

## Recent versions

- 1.0.1 (latest) — 2021-09-24
- 1.0.0 — 2021-09-23

## README

# <img src="assets/logo.svg?sanitize=true" width="24" height="24" alt="Stimulus"> Stimulus Webpack Helpers

## Using Stimulus Webpack Helpers

Call webpack's [`require.context`](https://webpack.js.org/api/module-methods/#require-context) helper with the path to the folder containing your Stimulus controllers. Then, pass the resulting context to the `Application#load` method using the `definitionsFromContext` helper:

```js
// src/application.js
import { Application } from "@hotwired/stimulus"
import { definitionsFromContext } from "@hotwired/stimulus-webpack-helpers"

window.Stimulus = Application.start()
const context = require.context("./controllers", true, /\.js$/)
Stimulus.load(definitionsFromContext(context))
```

## Getting Help & Contributing Back

Looking for the docs? Once you've read through the Handbook, consult the [Stimulus Reference](https://stimulus.hotwired.dev/reference/controllers) for API details.

Have a question about Stimulus? Connect with other Stimulus developers on the [Hotwire Discourse](https://discuss.hotwired.dev/) community forum.

Find a bug? Head over to our [issue tracker](https://github.com/hotwired/stimulus-webpack-helpers/issues) and we'll do our best to help. We love pull requests, too!

We expect all Stimulus contributors to abide by the terms of our [Code of Conduct](CODE_OF_CONDUCT.md).

## Acknowledgments

Stimulus is [MIT-licensed](LICENSE.md) open-source software from [Basecamp](https://basecamp.com/), the creators of [Ruby on Rails](http://rubyonrails.org).

Continuous integration VMs generously provided by [Sauce Labs](https://saucelabs.com/open-source).

---

© 2021 Basecamp, LLC.

---
_Source: https://npm.io/package/@hotwired/stimulus-webpack-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
