♪ Expo pre-build demystified. Now, this is a talk not just for beginners, but also advanced Expo users, because I believe the pre-build command is confusing. There's quite a lot of depth to it, and we may have some misconceptions or superstitions about it. So, this talk is going to cover first, what is Expo pre-build? It will introduce you to templates, as it's kind of hard to discuss one without the other. And then building upon that, will teach you how to build your own custom templates. And then finally, we'll bring all those skills together by introducing continuous nature generation.
So, first up, what is Expo pre-build? I think the easiest way to explain this is to just demonstrate what happens when you create an Expo app and then run pre-build on it. So, we'll do that. Run this command, create expo app, we'll just create expo for short, and you'll end up with a folder just like this. What it is, is an Expo Go app based on Expo template default. There are some restrictions with this, though. You can't use native code, or rather the only native APIs you can call are the ones from the Expo SDK. So, just a JavaScript app.
So, what if you wanted to go beyond an Expo Go app? Well, that's where pre-build comes in. You run the Expo pre-build command, and the thing that you will tend to see and that you will tend to be aware of is, this is the command that generates those iOS and Android folders. And the effect of this is it creates a development build. And this is a freestanding app, which is not dependent on the Expo Go client, where you can use any native modules you'd like. And the template that this pre-build is based on is Expo template bare minimum. So, we've got two templates here. What's going on? It's about time we talked about templates.
So, in my mind, there are two kinds of templates. These are not official terms, but I think it helps to discuss it. There's app templates and pre-build templates. We'll go into app templates first. So, app templates provide the starting boilerplate for an app, normally an Expo Go app, but we'll get into that. These will be familiar. There's the default template, which nowadays makes an Expo router app. There's blank, blank type scripting tabs. You know, the ones. An app template will look like this.
Comments