Skip to content

Commit 6618e29

Browse files
committed
Activating "debug" mode for Stimulus for dev builds
1 parent 78f17b3 commit 6618e29

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 3.1.0
4+
5+
* Automatically enabled Stimulus's "debug" mode when doing a dev build. You will
6+
now, while developing, see debugging information in your browser's console log!
7+
See #65.
8+
39
## 3.0.0
410

511
Dropped support for `stimulus` 2.0, in favor of `@hotwired/stimulus` version 3.

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ function identifierForContextKey(key) {
3131

3232
function startStimulusApp(context) {
3333
const application = Application.start();
34+
if (process.env.NODE_ENV === 'development') {
35+
application.debug = true;
36+
}
3437
if (context) {
3538
application.load(definitionsFromContext(context));
3639
}

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import symfonyControllers from './webpack/loader!@symfony/stimulus-bridge/contro
2020
export function startStimulusApp(context: any) {
2121
const application = Application.start();
2222

23+
if (process.env.NODE_ENV === 'development') {
24+
application.debug = true;
25+
}
26+
2327
if (context) {
2428
application.load(definitionsFromContext(context));
2529
}

0 commit comments

Comments
 (0)