Skip to content

Commit

Permalink
Ещё оддна попытка исправления для GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyAkkuratov committed May 30, 2024
1 parent 32d0830 commit 90ef5c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/weatherApp.js
Original file line number Diff line number Diff line change
@@ -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 }] */
Expand Down Expand Up @@ -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\/(?<cityName>.+)$/,
path: new RegExp(`^${PREFIX}/weather/(?<cityName>.+)$`),
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();
Expand Down
8 changes: 4 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require("path");
// const { DefinePlugin } = require("webpack");
const { DefinePlugin } = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");

const isProduction =
Expand Down Expand Up @@ -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: [
Expand Down

0 comments on commit 90ef5c0

Please sign in to comment.