Skip to content

Commit b8f54b9

Browse files
committed
fix: native:serve will no longer run the bundle
1 parent 3e660a7 commit b8f54b9

File tree

2 files changed

+11
-3
lines changed
  • resources/js/electron-plugin

2 files changed

+11
-3
lines changed

resources/js/electron-plugin/dist/server/php.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ const argumentEnv = getArgumentEnv();
2525
const appPath = getAppPath();
2626
mkdirpSync(bootstrapCache);
2727
function runningSecureBuild() {
28-
return existsSync(join(appPath, 'build', '__nativephp_app_bundle'));
28+
return existsSync(join(appPath, 'build', '__nativephp_app_bundle'))
29+
&& process.env.NODE_ENV !== 'development';
2930
}
3031
function shouldMigrateDatabase(store) {
3132
return store.get('migrated_version') !== app.getVersion()
3233
&& process.env.NODE_ENV !== 'development';
3334
}
3435
function shouldOptimize(store) {
35-
return store.get('optimized_version') !== app.getVersion();
36+
return runningSecureBuild();
3637
}
3738
function getPhpPort() {
3839
return __awaiter(this, void 0, void 0, function* () {

resources/js/electron-plugin/src/server/php.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ mkdirpSync(bootstrapCache);
2323

2424
function runningSecureBuild() {
2525
return existsSync(join(appPath, 'build', '__nativephp_app_bundle'))
26+
&& process.env.NODE_ENV !== 'development';
2627
}
2728

2829
function shouldMigrateDatabase(store) {
@@ -31,7 +32,13 @@ function shouldMigrateDatabase(store) {
3132
}
3233

3334
function shouldOptimize(store) {
34-
return store.get('optimized_version') !== app.getVersion();
35+
/*
36+
* For some weird reason,
37+
* the cached config is not picked up on subsequent launches,
38+
* so we'll just rebuilt it every time for now
39+
*/
40+
return runningSecureBuild();
41+
// return runningSecureBuild() && store.get('optimized_version') !== app.getVersion();
3542
}
3643

3744
async function getPhpPort() {

0 commit comments

Comments
 (0)