From 90ef5c034c85d42d9725af84bb848c946fa16513 Mon Sep 17 00:00:00 2001 From: Sergey Akkuratov Date: Thu, 30 May 2024 23:00:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=95=D1=89=D1=91=20=D0=BE=D0=B4=D0=B4=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B0=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20GitHub=20Pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/weatherApp.js | 8 ++++---- webpack.config.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/weatherApp.js b/src/weatherApp.js index 6485915..0eeb6b4 100644 --- a/src/weatherApp.js +++ b/src/weatherApp.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* eslint-disable no-use-before-define */ /* eslint-disable no-alert */ /* eslint no-param-reassign: ["error", { "props": false }] */ @@ -107,27 +108,26 @@ export default async function weatherApp(rootElement) { rootElement.addEventListener("click", (event) => { if (event.target instanceof HTMLAnchorElement) { event.preventDefault(); - // eslint-disable-next-line no-undef router.navigate(event.target.pathname); } }); router.addRoute({ - path: /^\/weather\/(?.+)$/, + path: new RegExp(`^${PREFIX}/weather/(?.+)$`), onEnter: async (params) => { updateWeather(params.cityName); }, }); router.addRoute({ - path: "/about", + path: `${PREFIX}/about`, onEnter: () => { rootElement.innerHTML = aboutTemplate; }, }); router.addRoute({ - path: "/", + path: `${PREFIX}/`, onEnter: () => { rootElement.innerHTML = mainTemplate; loadHistory(); diff --git a/webpack.config.js b/webpack.config.js index e433092..7a8bcb9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ const path = require("path"); -// const { DefinePlugin } = require("webpack"); +const { DefinePlugin } = require("webpack"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const isProduction = @@ -29,9 +29,9 @@ module.exports = { template: "src/index.html", filename: "404.html", }), - // new DefinePlugin({ - // PREFIX: JSON.stringify(PREFIX), - // }), + new DefinePlugin({ + PREFIX: JSON.stringify(PREFIX), + }), ], module: { rules: [