0

Part of my Expo/React native workflow involves deploying development versions of the application into my private web server. Then interested people can explore development build behavior by using Expo Go client.

Dev deployment is currently solved as simple Dockerfile:

FROM node:16
WORKDIR /usr/app/
COPY package.json package-lock.json /usr/app/
RUN npm install -g npm@latest
RUN npm install
COPY . /usr/app/
EXPOSE 19000
HEALTHCHECK --interval=60s --timeout=600s --start-period=10s --retries=3 CMD curl -f http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=android && curl -f http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios || exit 1
CMD [ "npx", "expo", "start" ]

While the following setup works, bundling occurs in runtime instead of build time. Healthcheck is a W/A to trigger bundling immediately and avoid long load times during the initial load.

In Expo docs, there is mention of npx expo export which creates relevant bundles in dist/ directory. I am able to execute this export and collect bundles for both iOS and Android platforms. Unfortunately, the Expo dev server (npx expo start) triggers bundling on initial fetch anyway.

Is it possible to achieve a behavior where Expo dev server will pick up those prebundled files and not re-bundle any code in runtime?

Łukasz Rogalski
  • 22,092
  • 8
  • 59
  • 93

0 Answers0