The traditional historic view of Joshua’s reference to the “book of the Law” is it refers to the Pentateuch that was written by Moses. That is the first five books of our current Bible known as Genesis, Exodus, Leviticus, Numbers, and Deuteronomy. The Pentateuch is also known as the Torah.
In fact, the word “Torah” is in the text at, among other places, Joshua 1:8.
The KJV translates Strong's H8451 in the following manner: law (219x).
There are some scholars most recently who believe that the Torah had four unique authors and was composed over hundreds of years. Even if one takes this view, however, it would not diminish the understanding to what Joshua was referring. For example, Joshua refers not just to the “book of the Law”, but also the “book of the Law of Moses” and the “book of the Law of God”. That would still be the Pentateuch.
As Moses the servant of the LORD commanded the children of Israel, as it is written in the book of the law of Moses,
Deuteronomy self describes the book of the law this way.
Take this book of the law, and put it in the side of the ark of the covenant of the LORD your God, that it may be there for a witness against thee.
Throughout the Israelite history in Chronicles and Kings there are numerous references to the book of the law of Moses. It was understood that Moses wrote the Pentateuch.
After the Dispersion when the Israelites regathered in the land under Nehemiah, the book of the law was still known as the first five books.
and they spake unto Ezra the scribe to bring the book of the law of Moses, which the LORD had commanded to Israel.
By the time of Christ, the division of the Hebrew Bible was identified as three sections, Law or Teachings, Prophets, Psalms or Writings. This is known as the Tanakh.
And he [Jesus Christ] said unto them, These are the words which I spake unto you, while I was yet with you, that all things must be fulfilled, which were written in the law of Moses, and in the prophets, and in the psalms, concerning me.
Some 2000 years ago it was common knowledge that the “book of the law” referred to the first five books of the Hebrew Bible.
For as many as are of the works of the law are under the curse: for it is written, Cursed is every one that continueth not in all things which are written in the book of the law to do them.
The point in showing the understanding centuries after Moses and Joshua is that the traditional historic view confirms to what the book of the law Joshua would be referring. It was the first five books of what is the Hebrew Bible.