2

I have a multi-page website. Each page has its own entry point. I am using the CommonsChunkPlugin to extract shared libraries into a common js file that is included on all of my pages.

I have one page that is different. This page runs some JavaScript and immediately redirects to another page. I want this page to load as quickly as possible. To achieve this I am in-lining the JavaScript. The JavaScript does use one of my shared libraries, and because of this, that library is extracted out of the entry via the CommonsChunkPlugin. I want to exempt this one entry from that.

I've been able to accomplish this by passing in every OTHER entry into the chunks parameter of the CommonsChunkPlugin, but this is a maintenance nightmare. Ideally there would be an excludeChunks parameter, but I don't see one. I suspect there's another, more elegant way to accomplish this.

Any help would be appreciated.

Brian Ball
  • 12,268
  • 3
  • 40
  • 51

0 Answers0