// This script creates a new index_{locale}.html file for each locale // that we support in the /dist folder. It modifies the paths in the // file so it includes the right files for the locale. import { LOCALES } from "../src/config"; import fs from "fs"; import path from "path"; const distDir = `${__dirname}/../dist/`; function updateHtmlFiles() { const fileNamesToFix = ["index.html", "debug.html"] .concat(LOCALES.map((locale) => `index_${locale}.html`)) .map((fileName) => path.join(distDir, fileName)); fileNamesToFix.forEach((filePath) => { let fileContent = fs.readFileSync(filePath).toString(); fileContent = fileContent.split(`"./dist/`).join(`"./`); const search = `