mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-06 07:54:21 +01:00
perf: lazy load mocks package
This commit is contained in:
@@ -6,10 +6,12 @@ import App from './App';
|
||||
|
||||
|
||||
if (process.env.REACT_APP_ENABLE_MOCKS) {
|
||||
const { worker } = require('./mocks/browser')
|
||||
worker.start({
|
||||
onUnhandledRequest: 'bypass'
|
||||
})
|
||||
import('./mocks/browser')
|
||||
.then(({ worker }) => {
|
||||
worker.start({
|
||||
onUnhandledRequest: 'bypass'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user