1
00:00:02,000 --> 00:00:05,000
Now, we did talk a lot about deployment

2
00:00:05,000 --> 00:00:05,000
and it matters,

3
00:00:05,000 --> 00:00:09,000
and we did talk a lot about this standard build

4
00:00:09,000 --> 00:00:10,000
with next build.

5
00:00:10,000 --> 00:00:14,000
And that works and is the standard build for a reason.

6
00:00:14,000 --> 00:00:16,000
It's easy to use and easy to deploy

7
00:00:16,000 --> 00:00:20,000
especially when using a service like Versal, as you saw.

8
00:00:20,000 --> 00:00:25,000
But I did also mention this alternative, next export.

9
00:00:25,000 --> 00:00:26,000
We can't run it like this,

10
00:00:26,000 --> 00:00:29,000
but we can go to the package.json file

11
00:00:29,000 --> 00:00:32,000
and add a script for that, like this.

12
00:00:32,000 --> 00:00:36,000
And here, I created a brand new basic project

13
00:00:36,000 --> 00:00:38,000
which you'll find attached now.

14
00:00:39,000 --> 00:00:42,000
It's a very basic project which only has one page

15
00:00:42,000 --> 00:00:44,000
which does nothing special.

16
00:00:44,000 --> 00:00:47,000
And whenever you have a project

17
00:00:47,000 --> 00:00:49,000
that needs no server side code,

18
00:00:49,000 --> 00:00:53,000
so no page revalidations, no fall backs,

19
00:00:53,000 --> 00:00:57,000
no server side props, no image optimization,

20
00:00:57,000 --> 00:00:59,000
that also requires server side code

21
00:00:59,000 --> 00:01:02,000
because it's done on-demand, on the fly.

22
00:01:02,000 --> 00:01:04,000
If you have such a project,

23
00:01:04,000 --> 00:01:06,000
so if you downloaded the attached project

24
00:01:06,000 --> 00:01:08,000
and run npm install in there,

25
00:01:08,000 --> 00:01:12,000
then you still need to run npm run build first,

26
00:01:12,000 --> 00:01:14,000
so this regular build command,

27
00:01:14,000 --> 00:01:17,000
you still need to do that first.

28
00:01:18,000 --> 00:01:20,000
But once that's finished,

29
00:01:20,000 --> 00:01:22,000
you can now run that export command

30
00:01:22,000 --> 00:01:24,000
which I added to the package.json file

31
00:01:24,000 --> 00:01:28,000
and this will now create such a static export.

32
00:01:28,000 --> 00:01:32,000
In this "out" folder you now have everything you need

33
00:01:32,000 --> 00:01:35,000
so you can take the content inside of that "out" folder

34
00:01:35,000 --> 00:01:39,000
and deploy that onto any static host.

35
00:01:39,000 --> 00:01:41,000
And you don't need anything else.

36
00:01:41,000 --> 00:01:44,000
You don't need a node server, nothing like that,

37
00:01:44,000 --> 00:01:47,000
but you have the limitations mentioned before.

38
00:01:47,000 --> 00:01:50,000
But that is an alternative for some pages,

39
00:01:50,000 --> 00:01:54,000
pages which don't use any server side features.

40
00:01:54,000 --> 00:01:57,000
And then you get a super slim static application

41
00:01:57,000 --> 00:01:59,000
which you can deploy

42
00:01:59,000 --> 00:02:02,000
and all you need then is a static host.

43
00:02:02,000 --> 00:02:03,000
So that is something

44
00:02:03,000 --> 00:02:06,000
which you probably won't use that often

45
00:02:06,000 --> 00:02:07,000
but which can be very useful

46
00:02:07,000 --> 00:02:10,000
for some applications and some projects

47
00:02:10,000 --> 00:02:12,000
and which are there for, of course,

48
00:02:12,000 --> 00:02:14,000
also wanted to cover here.

