Skip to content

Commit

Permalink
Dynamic URL based on Dev Environment
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-police committed Aug 29, 2024
1 parent 66c49aa commit 3bb13c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
var b_isDevelopment = (process.env.NODE_ENV == "development")


/** @type {import('next').NextConfig} */
const nextConfig = {
// enables static exports
Expand All @@ -15,7 +18,7 @@ const nextConfig = {
*
* @see https://nextjs.org/docs/app/api-reference/next-config-js/basePath
*/
basePath: "/binary-pattern-painter-online",
basePath: (!b_isDevelopment) ? "/binary-pattern-painter-online" : "",

distDir: 'build',

Expand Down
4 changes: 3 additions & 1 deletion src/js/modules/page_config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
var b_isDevelopment = (process.env.NODE_ENV == "development")


const PAGE_CONFIG = {
/**
* @type string
*/
home_url: "https://karl-police.github.io/binary-pattern-painter-online",
home_url: (!b_isDevelopment) ? "https://karl-police.github.io/binary-pattern-painter-online" : "../",
}


Expand Down

0 comments on commit 3bb13c7

Please sign in to comment.