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 963adec commit c4eb236
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/weatherApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default async function weatherApp(rootElement) {
if (event.target instanceof HTMLAnchorElement) {
event.preventDefault();
// eslint-disable-next-line no-undef
router.navigate(PREFIX + event.target.href);
router.navigate(PREFIX + event.target.pathname);
}
});

Expand Down
5 changes: 3 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { DefinePlugin } = require("webpack");

const PREFIX =
process.env.NODE_ENV === "production" ? "/OTUS_homework_lesson07" : "";
const isProduction =
process.argv[process.argv.indexOf("--mode") + 1] === "production";
const PREFIX = isProduction ? "/OTUS_homework_lesson07" : "";

module.exports = {
entry: "./src/index.js",
Expand Down

0 comments on commit c4eb236

Please sign in to comment.