ensure proper build mode for cordova

This commit is contained in:
Nacho Codoñer
2025-08-25 15:51:44 +02:00
parent 47ceed02ce
commit b2d9afec90
2 changed files with 29 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ const {
const {
setupCompilationTracking,
waitForFirstCompilation
waitForFirstCompilation,
} = require('./lib/compilation');
const {
@@ -62,6 +62,7 @@ const {
isMeteorAppProduction,
isMeteorAppDebug,
isMeteorAppConfigModernVerbose,
isMeteorAppNative,
} = require('meteor/tools-core/lib/meteor');
const {
@@ -123,7 +124,7 @@ if (isMeteorAppRun() || isMeteorAppBuild() || isMeteorAppTest()) {
} = setupCompilationTracking();
// For 'run' command, start Rspack in appropriate modes with distinct callbacks
if (isMeteorAppDevelopment()) {
if (isMeteorAppDevelopment() || !isMeteorAppNative()) {
startRspackClientServe({ onCompile: onCompileClient });
startRspackServerWatch({ onCompile: onCompileServer });
} else if (isMeteorAppProduction()) {

View File

@@ -183,6 +183,32 @@ export function isMeteorAppTestWatch() {
return isMeteorAppTest() && !Package?.meteor?.global?.currentCommand?.options?.once;
}
/**
* Check if the current Meteor current command is running Android.
* @returns {boolean}
*/
export function isMeteorAppNativeAndroid() {
return Package?.meteor?.global?.currentCommand?.options?.['android-device'] ||
Package?.meteor?.global?.currentCommand?.options?.['android'];
}
/**
* Check if the current Meteor current command is running iOS.
* @returns {boolean}
*/
export function isMeteorAppNativeIos() {
return Package?.meteor?.global?.currentCommand?.options?.['ios-device'] ||
Package?.meteor?.global?.currentCommand?.options?.['ios'];
}
/**
* Checks if the current Meteor command is running native.
* @returns {boolean}
*/
export function isMeteorAppNative() {
return isMeteorAppNativeAndroid() || isMeteorAppNativeIos();
}
/**
* Checks if the Meteor application is running in development mode.
* @returns {boolean} True if the application is in development mode, false otherwise.