Skip to content

Commit

Permalink
docs: update readme to reflect vite's deprecation of globEager (#12)
Browse files Browse the repository at this point in the history
The `globEager` function was deprecated as of Vite 3.0 and has
been removed in Vite 5.0. This updates the README to use the
suggested `glob` with eager argument instead.

https://vitejs.dev/guide/migration#removed-deprecated-apis
vitejs/vite#14118
  • Loading branch information
zokioki authored Dec 19, 2023
1 parent 3284a1a commit 2913937
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<br>

[globEager]: https://vitejs.dev/guide/features.html#glob-import
[import.meta.glob]: https://vitejs.dev/guide/features.html#glob-import
[jumpstart]: https://github.com/ElMassimo/jumpstart-vite
[stimulus handbook]: https://stimulus.hotwire.dev/handbook/installing
[stimulus]: https://github.com/hotwired/stimulus
Expand All @@ -35,14 +35,14 @@ npx ni stimulus-vite-helpers

## Usage 🚀

You can now register your Stimulus controllers using Vite's [globEager] and the `registerControllers` helper:
You can now register your Stimulus controllers using Vite's [import.meta.glob] and the `registerControllers` helper:

```ts
import { Application } from 'stimulus'
import { registerControllers } from 'stimulus-vite-helpers'

const application = Application.start()
const controllers = import.meta.globEager('./**/*_controller.js')
const controllers = import.meta.glob('./**/*_controller.js', { eager: true })
registerControllers(application, controllers)
```

Expand Down

0 comments on commit 2913937

Please sign in to comment.