expo-router 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/babel.js +4 -4
  2. package/package.json +1 -1
package/babel.js CHANGED
@@ -30,16 +30,16 @@ function getExpoRouterImportMode(projectRoot, platform) {
30
30
  if (process.env.EXPO_ROUTER_IMPORT_MODE) {
31
31
  return process.env.EXPO_ROUTER_IMPORT_MODE;
32
32
  }
33
+ const env = process.env.NODE_ENV || process.env.BABEL_ENV;
34
+
33
35
  const { exp } = getConfigMemo(projectRoot);
34
- let mode = [process.env.NODE_ENV, true].includes(
35
- exp.extra?.router?.asyncRoutes
36
- )
36
+ let mode = [env, true].includes(exp.extra?.router?.asyncRoutes)
37
37
  ? "lazy"
38
38
  : "sync";
39
39
 
40
40
  // TODO: Production bundle splitting
41
41
 
42
- if (process.env.NODE_ENV === "production" && mode === "lazy") {
42
+ if (env === "production" && mode === "lazy") {
43
43
  throw new Error(
44
44
  "Async routes are not supported in production yet. Set `extra.router.asyncRoutes` to `development`, `false`, or `undefined`."
45
45
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "main": "src/index.tsx",
5
5
  "types": "build/index.d.ts",
6
6
  "files": [