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.
- package/babel.js +4 -4
- 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 = [
|
|
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 (
|
|
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
|
);
|