disable msw in production mode
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# Copy this to .env.local and change what you want to test.
|
||||
VITE_UMBRACO_USE_MSW=on # on = turns on MSW, off = disables all mock handlers
|
||||
VITE_UMBRACO_INSTALL_STATUS=running # running or must-install or must-upgrade
|
||||
VITE_UMBRACO_INSTALL_PRECONFIGURED=false
|
||||
|
||||
4
src/Umbraco.Web.UI.Client/.env.production
Normal file
4
src/Umbraco.Web.UI.Client/.env.production
Normal file
@@ -0,0 +1,4 @@
|
||||
# Copy this to .env.local and change what you want to test.
|
||||
VITE_UMBRACO_INSTALL_STATUS=running # running or must-install or must-upgrade
|
||||
VITE_UMBRACO_INSTALL_PRECONFIGURED=false
|
||||
VITE_UMBRACO_USE_MSW=off
|
||||
@@ -1,5 +1,9 @@
|
||||
import 'element-internals-polyfill';
|
||||
|
||||
import { startMockServiceWorker } from './mocks/browser';
|
||||
|
||||
startMockServiceWorker();
|
||||
if (import.meta.env.VITE_UMBRACO_USE_MSW === 'on') {
|
||||
startMockServiceWorker();
|
||||
}
|
||||
|
||||
import('./app');
|
||||
|
||||
1
src/Umbraco.Web.UI.Client/src/vite-env.d.ts
vendored
1
src/Umbraco.Web.UI.Client/src/vite-env.d.ts
vendored
@@ -2,4 +2,5 @@
|
||||
interface ImportMetaEnv {
|
||||
VITE_UMBRACO_INSTALL_STATUS: 'running' | 'must-upgrade' | 'must-install';
|
||||
VITE_UMBRACO_INSTALL_PRECONFIGURED: string;
|
||||
VITE_UMBRACO_USE_MSW: 'on' | 'off';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user