Skip to content

Commit 9805e0d

Browse files
committed
Keep process.env.NODE_ENV === "development" in the built files, close #120
1 parent 29203f1 commit 9805e0d

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 4.0.1
4+
5+
* Fix `application.debug = true` by keeping `process.env.NODE_ENV` check in dist files, see https://github.com/symfony/stimulus-bridge/pull/121
6+
37
## 4.0.0
48

59
### Breaking changes

dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function identifierForContextKey(key) {
2525
//#region src/index.ts
2626
function startStimulusApp(context) {
2727
const application = Application.start();
28-
application.debug = true;
28+
if (process.env.NODE_ENV === "development") application.debug = true;
2929
if (context) application.load(definitionsFromContext(context));
3030
for (const controllerName in symfonyControllers) {
3131
if (!Object.prototype.hasOwnProperty.call(symfonyControllers, controllerName)) continue;

rolldown.config.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export default defineConfig([
1818
'@hotwired/stimulus',
1919
],
2020
plugins: [typescript()],
21+
define: {
22+
// Keep `process.env.NODE_ENV` as a string, so it can be replaced by Webpack when user builds its app
23+
'process.env.NODE_ENV': 'process.env.NODE_ENV',
24+
},
2125
},
2226

2327
/*

0 commit comments

Comments
 (0)