umalogic
umalogic

Reputation: 83

Ignore paths during next build

I work with a huge monorepo. The production build for our next app takes about 20 minutes. I am trying bring this number down.

Issue: I was exploring module.noParse callback exposed by webpack and noticed that during the build for server and client, not only the source files, but the mock json files, test utils and story files were being read. This happens twice(server & client). This was expected. There are some libs which export mocks and other files which are used by some other libraries.

In my opinion, resolving and reading files is one of costliest operations during a build step. I am trying to check if there is a way we can avoid reading these files during the build. Here is what I have tried so far:

"next": "12.3.4"

Am I on the right path here? I have spent a considerable amount of time trying to figure this out without any success.

Upvotes: 1

Views: 221

Answers (0)

Related Questions