add env to turn on and off extension mocking

This commit is contained in:
Jacob Overgaard
2023-02-24 09:10:11 +01:00
parent 77c7def9d7
commit 5e2a2ec390
4 changed files with 5 additions and 3 deletions

View File

@@ -3,3 +3,4 @@ VITE_UMBRACO_USE_MSW=on # on = turns on MSW, off = disables all mock handlers
VITE_UMBRACO_API_URL=http://localhost:11000
VITE_UMBRACO_INSTALL_STATUS=running # running or must-install or must-upgrade
VITE_MSW_QUIET=off # on = turns off MSW console logs, off = turns on MSW console logs
VITE_UMBRACO_EXTENSION_MOCKS=off # on = turns on extension mocks, off = turns off extension mocks

View File

@@ -64,8 +64,8 @@ switch (import.meta.env.VITE_UMBRACO_INSTALL_STATUS) {
handlers.push(serverHandlers.serverRunningHandler);
}
switch (import.meta.env.MODE) {
case 'development':
switch (import.meta.env.VITE_UMBRACO_EXTENSION_MOCKS) {
case 'on':
handlers.push(manifestsHandlers.manifestDevelopmentHandler);
break;

View File

@@ -17,7 +17,7 @@ import { handlers as redirectManagementHandlers } from './domains/redirect-manag
export const handlers = [
serverHandlers.serverRunningHandler,
serverHandlers.serverVersionHandler,
manifestsHandlers.manifestDevelopmentHandler,
manifestsHandlers.manifestEmptyHandler,
...installHandlers,
...upgradeHandlers,
...userHandlers,

View File

@@ -5,4 +5,5 @@ interface ImportMetaEnv {
VITE_UMBRACO_API_URL: string;
VITE_UMBRACO_USE_MSW: 'on' | 'off';
VITE_MSW_QUIET: 'on' | 'off';
VITE_UMBRACO_EXTENSION_MOCKS: 'on' | 'off';
}