import { FetchedData } from "../fetchPublicData"; import createFilenames from "../helpers/createFilenames"; import templatePaths from "../helpers/templatePaths"; import chunksByPage from "../helpers/chunksByPage"; import createCommonConfig from "../helpers/createCommonConfig"; import createPaths from "../helpers/createPaths"; import getPageAndGlobalTranslations from "../helpers/getPageAndGlobalTranslations"; import getLocales from "../helpers/getLocales"; // const HtmlWebpackPlugin = require("html-webpack-plugin"); const notFound = (responses: FetchedData): typeof HtmlWebpackPlugin[] => { const locales = getLocales(); return locales.map( locale => new HtmlWebpackPlugin({ filename: createFilenames.notFound(locale), template: templatePaths.notFound, chunks: chunksByPage.notFound, templateParameters: { ...createCommonConfig(locale, locales, createPaths.notFound), i18n: getPageAndGlobalTranslations(locale, "not-found") } }) ); }; export default notFound;