1
00:00:01,220 --> 00:00:05,960
Let's take care of this whole little issue around replacing that process in the node envy environment

2
00:00:05,960 --> 00:00:06,410
variable.

3
00:00:07,350 --> 00:00:11,850
Now, you may recall that we've done something very similar to this earlier on inside the course, specifically

4
00:00:11,850 --> 00:00:17,370
around its build, when we put our bundled together so I can go into my client project very quickly,

5
00:00:18,060 --> 00:00:21,290
find Sarsae bundler index inducts.

6
00:00:22,220 --> 00:00:27,410
But here's where we made use of Eskild and instead of here, remember, we put together this defined

7
00:00:27,410 --> 00:00:32,060
section, we put the stuff inside of here to do something very similar to what we need to do right now.

8
00:00:32,299 --> 00:00:37,190
We need to find any instance of processing and bobbly inside of our source code and replace it with

9
00:00:37,190 --> 00:00:38,360
a string of production.

10
00:00:38,900 --> 00:00:41,420
We had done something very similar for a string of global.

11
00:00:41,420 --> 00:00:43,070
We replaced it with window as well.

12
00:00:44,020 --> 00:00:50,890
We need to do the same thing here, so you might think, well, could we use Eskild we use to just replace

13
00:00:50,890 --> 00:00:51,790
that string for us?

14
00:00:52,030 --> 00:00:53,730
Well, that kind of seems like overkill.

15
00:00:53,830 --> 00:00:54,490
It does.

16
00:00:54,500 --> 00:00:54,790
Yes.

17
00:00:54,790 --> 00:00:57,160
Bill does a lot more than just replace one simple string.

18
00:00:57,370 --> 00:01:02,920
But I just want to think about some other possible benefits of using E build when we start to build

19
00:01:02,920 --> 00:01:04,290
up our Seelie project.

20
00:01:04,900 --> 00:01:07,870
So let's take a look at a diagram just to understand something really quickly.

21
00:01:09,430 --> 00:01:14,710
Remember, at some point in time, a user is going to run a command like NPM install just note, or

22
00:01:14,710 --> 00:01:18,190
of course they might do just note or whatever else.

23
00:01:19,270 --> 00:01:24,410
If they install this module globally on their machine, they're going to install the jazz note package.

24
00:01:24,670 --> 00:01:29,110
This is kind of a diagram of all the files and folders or really just the folders they would install.

25
00:01:29,710 --> 00:01:31,450
They would get just note inside.

26
00:01:31,450 --> 00:01:36,580
There would be our node modules directory on their machine, along with all the dependencies that just

27
00:01:36,580 --> 00:01:38,080
note requires to work correctly.

28
00:01:38,870 --> 00:01:43,540
So in our case, just note requires our local API local client.

29
00:01:43,930 --> 00:01:45,430
It also requires express.

30
00:01:45,430 --> 00:01:50,530
And Commander, I just want to point out that there are a fair number of dependencies we have to install

31
00:01:50,680 --> 00:01:53,500
along with just note whenever a user runs this command.

32
00:01:54,700 --> 00:01:59,440
And when we start thinking about a user actually running a note or our command line tool, let's say

33
00:01:59,440 --> 00:02:05,200
using NPCs whenever they run this command, they're going to be downloading all the dependencies of

34
00:02:05,210 --> 00:02:09,110
just note before they can actually or where they can actually execute.

35
00:02:09,150 --> 00:02:10,060
Just note itself.

36
00:02:10,930 --> 00:02:16,030
Just want to point out that making that download process as fast as possible is actually kind of desirable.

37
00:02:16,090 --> 00:02:22,150
In other words, if I run a note, I want to see that development server where our API launch as fast

38
00:02:22,150 --> 00:02:22,930
as possible.

39
00:02:24,500 --> 00:02:29,840
So we kind of have to aligned concerns here, on the one hand, we want to replace that environment

40
00:02:29,840 --> 00:02:34,880
variable and on the other hand, we also want to make sure that whatever amount of code user downloads

41
00:02:34,880 --> 00:02:38,150
to install our jazz note package is as small as possible.

42
00:02:38,780 --> 00:02:39,750
So here's my idea.

43
00:02:40,160 --> 00:02:42,350
I think that we should apply.

44
00:02:42,770 --> 00:02:43,610
Yes, build.

45
00:02:44,560 --> 00:02:50,500
To our Seelie package, I think that rather than only compiling the thing with TypeScript, I think

46
00:02:50,500 --> 00:02:52,960
that we should also attempt to bundle the entire thing.

47
00:02:53,470 --> 00:02:59,470
If we apply a bundler to our Seelie package, that means we're going to take our index to file the survey

48
00:02:59,860 --> 00:03:04,480
file and all other dependencies that these things require to work correctly.

49
00:03:05,140 --> 00:03:07,450
And we're going to put out just one single file.

50
00:03:07,460 --> 00:03:13,080
Hopefully that's going to contain all the source code that is actually required to run our Seelie.

51
00:03:13,720 --> 00:03:19,660
That means that whenever a user runs at a book or jazz note, whatever we call it, command, they're

52
00:03:19,660 --> 00:03:24,670
going to download a very small amount of JavaScript as opposed to installing several different dependencies.

53
00:03:26,020 --> 00:03:27,950
I think that this might actually be a really good idea.

54
00:03:28,020 --> 00:03:30,360
We can make it really fast to run.

55
00:03:31,260 --> 00:03:36,990
And in addition, we can also handle replacing this replacement right here of that string with production

56
00:03:37,200 --> 00:03:40,740
if we just add in its build into our build process.

57
00:03:42,510 --> 00:03:48,150
So in other words, instead of our package that Jason file, rather than only doing right here, we

58
00:03:48,150 --> 00:03:53,850
should do and s build command, we should make use of e build the bundle up our entire project.

59
00:03:54,830 --> 00:03:55,790
That's going to be our goal.

60
00:03:56,060 --> 00:03:57,030
Let's take a pause right here.

61
00:03:57,080 --> 00:04:01,400
We're going to add in Eskild in just a moment and then wired up in the next video.

