Search code examples
angularwixwindows-installer

Wix Installer copy dynamically named Angular files?


With wix installer our file names are explicitly named. Is there a way to grab files that have dynamic names? For example in Angular with hashing they are always dynamic so this prevent caching on the server. I have them as static named but this is introducing alot of caching issues in our production environment with new builds.

app.bundle.js should be app.bundle.343423432423323123945238.js

<Component Id="app.bundle.js" Guid="{88FF7F86-D8E1-42F0-9EEC-365342AE57DB}">
  <File Id="app.bundle.js" KeyPath="yes" Source="$(var.TargetDir)..\dist\app.bundle.js" />
</Component>
<Component Id="polyfills.bundle.js" Guid="{CB3898F1-E382-4CDD-91ED-D4E0D52332D2}">
  <File Id="polyfills.bundle.js" KeyPath="yes" Source="$(var.TargetDir)..\dist\polyfills.bundle.js" />
</Component>
<Component Id="styles.bundle.js" Guid="{B4E38316-CADA-4CE9-99EF-C019F6B2C3A7}">
  <File Id="styles.bundle.js" KeyPath="yes" Source="$(var.TargetDir)..\dist\styles.bundle.js" />
</Component>
<Component Id="vendor.bundle.js" Guid="{5A2393C4-FB11-43F6-A832-E047525C4824}">
  <File Id="vendor.bundle.js" KeyPath="yes" Source="$(var.TargetDir)..\dist\vendor.bundle.js" />
</Component>

Solution

  • While I normally rant against this type of stuff for 99% of applications, NodeJS based applications generally benefit from the use of a program such Heat to harvest the files dynamically as part of a prebuild step.

    You will been to use Major Upgrades and schedule RemoveExistingProducts early on to get a good experience as your components will be changing every single build.