Web Package Caching Between Entry Points

I need to create a file for each client for our library, but the library itself is the same, and the only difference is the only client configuration file that is added to the main library file.

Today we do this:

{
  entry: {
    customer1: ["customer1-config.js", "main.js"],
    customer2: ["customer2-config.js", "main.js"],
  }
}

The problem with this is that the file is being main.jsrebuilt for each client.

Is there a way to build it only once and combine it for each client?

Update: The output should be that each entry point will contain the entire file main.jsand user configuration of the client.

+4
source share
1 answer

Make two assemblies:

  • , . .
  • ( ) dist, , .

, . , . , , .

+2

Source: https://habr.com/ru/post/1678761/


All Articles