3

I'm wondering why I seems to be the only one with this problem. I didn't find a solution here with search.

I'm planning to use different index.html files for different locales in angular.

That's not working for me:

            "de": {
          "aot": true,
          "budgets": [
            {
              "type": "anyComponentStyle",
              "maximumWarning": "6kb"
            }
          ],
          "index": {
            "input": "src/index_de.html",
            "output": "index.html"
          },
          "outputPath": "dist/frontend",
          "i18nFile": "src/locale/messages.de.xlf",
          "i18nLocale": "de"
        },

I was expecting ng build to replace the index file. But it does not.

My workaround now is to manually copy index_de.htm to index.htm and build the project and do the same with english. So I have to build twice.

Any ideas? Thanks in advance!

BigRed
  • 31
  • 1

1 Answers1

0

You need to pass the index file directly to the index key, under the specific build configuration you want that index file to be used for.

configurations: {
    a: {
        index: "src/index_a.html"
    },
    b: {
        index: "src/index_b.html"
    }
}

Sam
  • 1,736
  • 8
  • 15
  • I tried this - but it did not work neither. The problem might be that the higher ordered "build" settings ("configurations" is inside "build") has already a index-setting. But I cannot remove that. The order is build -> configuration -> then "de" or "en" – BigRed Feb 04 '21 at 20:29