Skip to content

Commit c4bba2e

Browse files
committed
[fix] trigger reload on .env change
1 parent ad95e1d commit c4bba2e

File tree

1 file changed

+4
-2
lines changed
  • src/lib/client/adapters/webcontainer

1 file changed

+4
-2
lines changed

src/lib/client/adapters/webcontainer/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ async function _create(stubs) {
164164
const will_restart = new_stubs.some(
165165
(stub) =>
166166
stub.type === 'file' &&
167-
(stub.name === '/vite.config.js' || stub.name === '/svelte.config.js')
167+
(stub.name === '/vite.config.js' ||
168+
stub.name === '/svelte.config.js' ||
169+
stub.name === '/.env')
168170
);
169171
const promise = will_restart
170172
? new Promise((fulfil, reject) => {
@@ -200,7 +202,7 @@ async function _create(stubs) {
200202

201203
// Also trigger a reload of the iframe in case new files were added / old ones deleted,
202204
// because that can result in a broken UI state
203-
return will_restart || vite_error || old.size || new_stubs.length;
205+
return will_restart || vite_error || !!old.size || !!new_stubs.length;
204206
}
205207

206208
/**

0 commit comments

Comments
 (0)