How to detect env in `createServerData`

Hey there, during development I like to run npm run dev on my site, so I can render it locally in the browser and quickly iterate design. With npm run build it'll create the code that is actually run on the server environment. Now, inside of createServerData the db I have available on the server is not available when just running npm run dev, so I would like to inject some test-data. How can I determine whether the app is run via run dev or run build?
1 Reply
Bersaelor
Bersaelor13mo ago
process.env.NODE_ENV == "development" did the trick