Let's install its build into our Seelie project, will then add in a new build script or maybe just
replace the existing pre publish only one, we're going to make sure that we bundle up the entire Seelie
and also do that little bit of text replacement as well.
The first thing we have to do is make use of Lernout to add in a package to only Seelie.
Let's go back over to our terminal and take care of that right away.
So at my terminal, I'll do Ellena add.
We want to get us build at zero eight to six.
I want to get the exact version, and I also want to save this as a development dependancy.
I'm also going to add on a scope and we want to make sure that we only add this into our Seelie package,
remember, SCOP needs to be whatever name we added in the Seelie Packages name field right here.
So for me, it is just note for you it will definitely be something else.
So there's our command.
I'm going to run that.
And we should see installed rather quickly.
Now, while you are installing modules with Alanah, it is actually going to take a couple of manual
changes to your package JSON file.
So just be aware that in general, whenever you are installing something with Lernout, you do not go
into your package on file and start messing around with stuff inside of your.
But in this case, it looks like everything was installed rather quickly, so back inside of our package,
not on file for our Seelie project, let's update the pre publish only script right here.
Rather than just doing it, we're going to instead run build in its command line form.
Remember, we had previously ran Eskild inside the browser using Web assembly.
That's not really its primary purpose.
Its primary purpose is actually as a command line tool.
We're going to use it.
And it's more native environment here.
We're going to add on a couple of different options just to specify that we want to bundle our project,
some other options to say that we want to replace that string and some other related things.
So the main people that we want to start from for our bundling is going to be our SIRC index not to
file, so I'm going to put in Eskild.
Sarsae index dot, yes.
And we're going to add on a pretty good number of options, do this thing I'm going to first put on
a dash dash platform equals Noad.
Then a dash dash out file.
So this is going to be where the bundled code gets placed, that's going to be our disked index file.
We want to bundle up, we're going to put on dash, dash, bundle, I want to minifie it.
And then here's the kind of nasty bit that we have to add in, we're going to put in Dash Dash, define
Fullan Process N.V., Noad M.V..
Equals and they're going to put in a couple of slashes here, and I'm going to be honest, if you're
on windows, this command might not work entirely correct correctly.
So you might have to do a little bit of troubleshooting if you are on windows.
We're going to put in.
Backslash, backslash, backslash, double quotes, production, backslash, backslash, backslash,
another double quotes.
OK, that's it.
Let's now go back over to our terminal, we're going to try running this publish only command manually
inside of our project and just see what happens.
But my terminal, I'm going to change into my project and do an NPM run republish only.
OK, well, I see a warning or two warnings are totally fine, you will notice that one warning is about
our usage of required resolve right here.
The other warning is related to a required statement, and this is coming from some code inside of Express,
but overall but these warnings are totally fine if you want to, we can optionally add on a little correction
to make that first warning go away, but it's not actually strictly required.
I'm going to go back over to my editor, find the directory and then find our built index, not just
file inside there, that should contain the entire contents of our entire bundled application.
So everything is inside of your everything from express you commander to our local API.
It's all inside of you're the one exception is that we're technically not including our local client
package inside of this index file.
The reason for that is that we're not actually importing anything from local client.
Instead, remember, we are only trying to serve out that bill directory.
So now one other very small optimized optimization we can do back inside of our package, not just on
file.
We no longer are required to actually add in these dependencies anymore because these dependencies are
now technically included in our bundle that is built during development time.
So I can move these dependencies into the dev dependency section.
But the one catch here is that if we do that, we still have we then have to add in local client as
a dependency.
So we still have that directory available when we eventually install all the stuff on a user's machine.
So if we're going to add all this over to dev dependencies, we do have to add in at.
James notes or whatever your organization name is, local client.
One point zero point zero do the dependancy section, and again, that is because we are not including
anything from that inside of our bundle, but we still want it to be included whenever a user installs
our Seelie onto their machine.
OK, so that's pretty much it.
This all looks pretty good, so we're going to pause right here when we come back in the next video,
I think we're ready to finally deploy this thing off to 9pm.
So actually publish all this stuff and then make sure that it's all working as expected.
There's one last little step.
However, let's not forget that get commit.
We're going to make use of get here as well.
So maybe just one other very small step.