1
00:00:01,100 --> 00:00:06,170
Let's install its build into our Seelie project, will then add in a new build script or maybe just

2
00:00:06,170 --> 00:00:11,240
replace the existing pre publish only one, we're going to make sure that we bundle up the entire Seelie

3
00:00:11,330 --> 00:00:13,820
and also do that little bit of text replacement as well.

4
00:00:14,560 --> 00:00:18,410
The first thing we have to do is make use of Lernout to add in a package to only Seelie.

5
00:00:18,630 --> 00:00:21,040
Let's go back over to our terminal and take care of that right away.

6
00:00:21,990 --> 00:00:24,360
So at my terminal, I'll do Ellena add.

7
00:00:25,260 --> 00:00:30,720
We want to get us build at zero eight to six.

8
00:00:31,630 --> 00:00:36,310
I want to get the exact version, and I also want to save this as a development dependancy.

9
00:00:37,450 --> 00:00:42,700
I'm also going to add on a scope and we want to make sure that we only add this into our Seelie package,

10
00:00:43,060 --> 00:00:48,440
remember, SCOP needs to be whatever name we added in the Seelie Packages name field right here.

11
00:00:48,460 --> 00:00:51,880
So for me, it is just note for you it will definitely be something else.

12
00:00:53,970 --> 00:00:54,760
So there's our command.

13
00:00:54,780 --> 00:00:55,410
I'm going to run that.

14
00:00:57,780 --> 00:00:59,490
And we should see installed rather quickly.

15
00:01:00,470 --> 00:01:04,450
Now, while you are installing modules with Alanah, it is actually going to take a couple of manual

16
00:01:04,459 --> 00:01:06,530
changes to your package JSON file.

17
00:01:06,950 --> 00:01:11,060
So just be aware that in general, whenever you are installing something with Lernout, you do not go

18
00:01:11,060 --> 00:01:14,660
into your package on file and start messing around with stuff inside of your.

19
00:01:15,820 --> 00:01:20,230
But in this case, it looks like everything was installed rather quickly, so back inside of our package,

20
00:01:20,230 --> 00:01:25,270
not on file for our Seelie project, let's update the pre publish only script right here.

21
00:01:26,220 --> 00:01:32,420
Rather than just doing it, we're going to instead run build in its command line form.

22
00:01:32,670 --> 00:01:36,590
Remember, we had previously ran Eskild inside the browser using Web assembly.

23
00:01:36,860 --> 00:01:38,470
That's not really its primary purpose.

24
00:01:38,480 --> 00:01:40,970
Its primary purpose is actually as a command line tool.

25
00:01:41,360 --> 00:01:42,010
We're going to use it.

26
00:01:42,010 --> 00:01:43,610
And it's more native environment here.

27
00:01:44,240 --> 00:01:48,500
We're going to add on a couple of different options just to specify that we want to bundle our project,

28
00:01:48,770 --> 00:01:53,120
some other options to say that we want to replace that string and some other related things.

29
00:01:54,300 --> 00:01:59,850
So the main people that we want to start from for our bundling is going to be our SIRC index not to

30
00:02:00,060 --> 00:02:02,190
file, so I'm going to put in Eskild.

31
00:02:03,290 --> 00:02:06,050
Sarsae index dot, yes.

32
00:02:07,060 --> 00:02:11,110
And we're going to add on a pretty good number of options, do this thing I'm going to first put on

33
00:02:11,110 --> 00:02:13,900
a dash dash platform equals Noad.

34
00:02:16,600 --> 00:02:19,670
Then a dash dash out file.

35
00:02:19,720 --> 00:02:26,200
So this is going to be where the bundled code gets placed, that's going to be our disked index file.

36
00:02:27,850 --> 00:02:32,800
We want to bundle up, we're going to put on dash, dash, bundle, I want to minifie it.

37
00:02:34,630 --> 00:02:39,400
And then here's the kind of nasty bit that we have to add in, we're going to put in Dash Dash, define

38
00:02:39,850 --> 00:02:44,350
Fullan Process N.V., Noad M.V..

39
00:02:45,440 --> 00:02:50,120
Equals and they're going to put in a couple of slashes here, and I'm going to be honest, if you're

40
00:02:50,120 --> 00:02:53,820
on windows, this command might not work entirely correct correctly.

41
00:02:53,900 --> 00:02:56,480
So you might have to do a little bit of troubleshooting if you are on windows.

42
00:02:56,960 --> 00:02:57,590
We're going to put in.

43
00:02:58,610 --> 00:03:05,840
Backslash, backslash, backslash, double quotes, production, backslash, backslash, backslash,

44
00:03:06,350 --> 00:03:07,340
another double quotes.

45
00:03:10,760 --> 00:03:12,280
OK, that's it.

46
00:03:13,680 --> 00:03:17,820
Let's now go back over to our terminal, we're going to try running this publish only command manually

47
00:03:17,820 --> 00:03:19,800
inside of our project and just see what happens.

48
00:03:20,940 --> 00:03:28,620
But my terminal, I'm going to change into my project and do an NPM run republish only.

49
00:03:32,200 --> 00:03:39,280
OK, well, I see a warning or two warnings are totally fine, you will notice that one warning is about

50
00:03:39,280 --> 00:03:42,700
our usage of required resolve right here.

51
00:03:44,420 --> 00:03:50,060
The other warning is related to a required statement, and this is coming from some code inside of Express,

52
00:03:50,570 --> 00:03:56,390
but overall but these warnings are totally fine if you want to, we can optionally add on a little correction

53
00:03:56,390 --> 00:04:00,170
to make that first warning go away, but it's not actually strictly required.

54
00:04:01,010 --> 00:04:07,310
I'm going to go back over to my editor, find the directory and then find our built index, not just

55
00:04:07,310 --> 00:04:12,560
file inside there, that should contain the entire contents of our entire bundled application.

56
00:04:13,070 --> 00:04:19,670
So everything is inside of your everything from express you commander to our local API.

57
00:04:19,680 --> 00:04:25,070
It's all inside of you're the one exception is that we're technically not including our local client

58
00:04:25,070 --> 00:04:27,440
package inside of this index file.

59
00:04:27,950 --> 00:04:31,550
The reason for that is that we're not actually importing anything from local client.

60
00:04:31,820 --> 00:04:35,150
Instead, remember, we are only trying to serve out that bill directory.

61
00:04:38,540 --> 00:04:43,130
So now one other very small optimized optimization we can do back inside of our package, not just on

62
00:04:43,130 --> 00:04:43,560
file.

63
00:04:44,420 --> 00:04:49,700
We no longer are required to actually add in these dependencies anymore because these dependencies are

64
00:04:49,700 --> 00:04:53,900
now technically included in our bundle that is built during development time.

65
00:04:54,620 --> 00:04:58,370
So I can move these dependencies into the dev dependency section.

66
00:04:59,030 --> 00:05:03,920
But the one catch here is that if we do that, we still have we then have to add in local client as

67
00:05:03,920 --> 00:05:04,580
a dependency.

68
00:05:04,790 --> 00:05:09,950
So we still have that directory available when we eventually install all the stuff on a user's machine.

69
00:05:10,520 --> 00:05:15,050
So if we're going to add all this over to dev dependencies, we do have to add in at.

70
00:05:16,390 --> 00:05:20,470
James notes or whatever your organization name is, local client.

71
00:05:24,290 --> 00:05:29,570
One point zero point zero do the dependancy section, and again, that is because we are not including

72
00:05:29,570 --> 00:05:34,370
anything from that inside of our bundle, but we still want it to be included whenever a user installs

73
00:05:34,370 --> 00:05:35,870
our Seelie onto their machine.

74
00:05:38,340 --> 00:05:39,530
OK, so that's pretty much it.

75
00:05:40,500 --> 00:05:44,030
This all looks pretty good, so we're going to pause right here when we come back in the next video,

76
00:05:44,040 --> 00:05:47,160
I think we're ready to finally deploy this thing off to 9pm.

77
00:05:47,190 --> 00:05:51,150
So actually publish all this stuff and then make sure that it's all working as expected.

78
00:05:51,810 --> 00:05:52,770
There's one last little step.

79
00:05:52,770 --> 00:05:54,570
However, let's not forget that get commit.

80
00:05:54,570 --> 00:05:55,980
We're going to make use of get here as well.

81
00:05:56,010 --> 00:05:58,200
So maybe just one other very small step.

