mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-28 19:44:23 +01:00
fix: added build-dev script that enables mocks in deployment
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
"scripts": {
|
||||
"start": "craco start",
|
||||
"build": "craco build",
|
||||
"build-dev": "REACT_APP_ENABLE_MOCKS=true craco build",
|
||||
"test": "craco test",
|
||||
"eject": "react-scripts eject",
|
||||
"predeploy": "set REACT_APP_FOR_GITHUB=true&& npm run build",
|
||||
|
||||
@@ -6,7 +6,7 @@ import App from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (process.env.NODE_ENV === 'development' || process.env.REACT_APP_ENABLE_MOCKS) {
|
||||
const { worker } = require('./mocks/browser')
|
||||
worker.start()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user