File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed
Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -6,17 +6,12 @@ import App from './App'
66
77const root = ReactDOM . createRoot ( document . getElementById ( 'root' ) ! )
88
9- // Setup MSW mock server in development
10- if ( process . env . NODE_ENV === 'development' ) {
11- // Certify MSW's Service Worker is available before start React app.
12- import ( '../mocks/browser' )
13- . then ( async ( { worker } ) => {
14- return worker . start ( )
15- } ) // Run <App /> when Service Worker is ready to intercept requests.
16- . then ( ( ) => {
17- root . render ( < App /> )
18- } )
19- // Never setup MSW mock server in production
20- } else if ( process . env . NODE_ENV === 'production' ) {
21- root . render ( < App /> )
22- }
9+ // Setup MSW mock server in both development and production
10+ // Certify MSW's Service Worker is available before starting React app
11+ import ( '../mocks/browser' )
12+ . then ( async ( { worker } ) => {
13+ return worker . start ( )
14+ } ) // Run <App /> when Service Worker is ready to intercept requests
15+ . then ( ( ) => {
16+ root . render ( < App /> )
17+ } )
You can’t perform that action at this time.
0 commit comments