Changing UI Bundler Mode
The UI Mode determines what optimizations are used to provide a better experience at either development or end-user utilization. The default behavior for the UI mode depends on the App#mode but it can be adjusted through UiSdlConfig for more fine-grained control.
The development mode optimizes readability and debuggability of code, making it ideal for working on new features. On the other hand, production mode optimizes for performance, making it poor for developing in but very good for end users.
Webpack mode through app mode
If the App#mode is AppMode#PROD or AppMode#TRIAL, UiBundler will use production mode for serving bundles. In both of these modes, bundles cannot be generated through UiBundler#generateBundles, so this will only act for serving the bundled UI. All other AppModes will result in development mode for UiBundler. In these modes, bundles can be generated through UiBundler#generateBundles.
Webpack mode through UiSdlConfig
No matter what the AppMode is, the UiSdlConfig configuration for webpack mode will take priority if it is set. You can check if it is set with
UiSdlConfig.inst().infrastructure.webpackMode;This will return one of: production, development, or undefined. If it returns undefined, then the AppMode will be used. To set this, you can run
UiSdlConfig.inst().setConfigValue('infrastructure.webpackMode', 'development');Replacing development with production if desired.