Let's take care of this whole little issue around replacing that process in the node envy environment
variable.
Now, you may recall that we've done something very similar to this earlier on inside the course, specifically
around its build, when we put our bundled together so I can go into my client project very quickly,
find Sarsae bundler index inducts.
But here's where we made use of Eskild and instead of here, remember, we put together this defined
section, we put the stuff inside of here to do something very similar to what we need to do right now.
We need to find any instance of processing and bobbly inside of our source code and replace it with
a string of production.
We had done something very similar for a string of global.
We replaced it with window as well.
We need to do the same thing here, so you might think, well, could we use Eskild we use to just replace
that string for us?
Well, that kind of seems like overkill.
It does.
Yes.
Bill does a lot more than just replace one simple string.
But I just want to think about some other possible benefits of using E build when we start to build
up our Seelie project.
So let's take a look at a diagram just to understand something really quickly.
Remember, at some point in time, a user is going to run a command like NPM install just note, or
of course they might do just note or whatever else.
If they install this module globally on their machine, they're going to install the jazz note package.
This is kind of a diagram of all the files and folders or really just the folders they would install.
They would get just note inside.
There would be our node modules directory on their machine, along with all the dependencies that just
note requires to work correctly.
So in our case, just note requires our local API local client.
It also requires express.
And Commander, I just want to point out that there are a fair number of dependencies we have to install
along with just note whenever a user runs this command.
And when we start thinking about a user actually running a note or our command line tool, let's say
using NPCs whenever they run this command, they're going to be downloading all the dependencies of
just note before they can actually or where they can actually execute.
Just note itself.
Just want to point out that making that download process as fast as possible is actually kind of desirable.
In other words, if I run a note, I want to see that development server where our API launch as fast
as possible.
So we kind of have to aligned concerns here, on the one hand, we want to replace that environment
variable and on the other hand, we also want to make sure that whatever amount of code user downloads
to install our jazz note package is as small as possible.
So here's my idea.
I think that we should apply.
Yes, build.
To our Seelie package, I think that rather than only compiling the thing with TypeScript, I think
that we should also attempt to bundle the entire thing.
If we apply a bundler to our Seelie package, that means we're going to take our index to file the survey
file and all other dependencies that these things require to work correctly.
And we're going to put out just one single file.
Hopefully that's going to contain all the source code that is actually required to run our Seelie.
That means that whenever a user runs at a book or jazz note, whatever we call it, command, they're
going to download a very small amount of JavaScript as opposed to installing several different dependencies.
I think that this might actually be a really good idea.
We can make it really fast to run.
And in addition, we can also handle replacing this replacement right here of that string with production
if we just add in its build into our build process.
So in other words, instead of our package that Jason file, rather than only doing right here, we
should do and s build command, we should make use of e build the bundle up our entire project.
That's going to be our goal.
Let's take a pause right here.
We're going to add in Eskild in just a moment and then wired up in the next video.