Skip to content

Commit

Permalink
refactor: improved the path settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Jun 17, 2021
1 parent 2499420 commit 5b096f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
11 changes: 7 additions & 4 deletions packages/dantalion-web-playground/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ const { withSentryConfig } = require('@sentry/nextjs');

const localDomain = '';
const productDomain = 'https://kurone-kito.github.io';
const productPath = '/dantalion/';
const isCIProd = !!process.env.CI && process.env.NODE_ENV === 'production';
const assetPrefix = isCIProd ? productDomain + productPath : localDomain;
const productPath = '/dantalion';
const isProd = process.env.NODE_ENV === 'production';
const isCI = !!process.env.CI;
const path = !isCI && isProd ? '' : productPath;
const assetPrefix = (isCI && isProd ? productDomain : localDomain) + path;

/** @type {Partial<import('next/dist/next-server/server/config-shared').NextConfig>} */
const providedExports = {
assetPrefix,
env: { assetPrefix, productDomain, productPath },
basePath: path,
env: { assetPrefix },
future: { strictPostcssConfiguration: true },
// i18n: { defaultLocale: 'en', locales: ['en', 'ja'] },
reactStrictMode: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Component: VFC<Props> = ({ baseUrl = '' }) => {
<link
rel="apple-touch-icon"
sizes="180x180"
href={`${baseUrl}/dantalion/favicons/apple-touch-icon.png`}
href={`${baseUrl}/favicons/apple-touch-icon.png`}
/>
<link rel="bookmark" href={rootUrl} />
<link rel="canonical" href={rootUrl} />
Expand All @@ -27,39 +27,33 @@ const Component: VFC<Props> = ({ baseUrl = '' }) => {
rel="icon"
type="image/png"
sizes="32x32"
href={`${baseUrl}/dantalion/favicons/favicon-32x32.png`}
href={`${baseUrl}/favicons/favicon-32x32.png`}
/>
<link
rel="icon"
type="image/png"
sizes="194x194"
href={`${baseUrl}/dantalion/favicons/favicon-194x194.png`}
href={`${baseUrl}/favicons/favicon-194x194.png`}
/>
<link
rel="icon"
type="image/png"
sizes="192x192"
href={`${baseUrl}/dantalion/favicons/android-chrome-192x192.png`}
href={`${baseUrl}/favicons/android-chrome-192x192.png`}
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href={`${baseUrl}/dantalion/favicons/favicon-16x16.png`}
/>
<link
rel="manifest"
href={`${baseUrl}/dantalion/favicons/site.webmanifest`}
href={`${baseUrl}/favicons/favicon-16x16.png`}
/>
<link rel="manifest" href={`${baseUrl}/favicons/site.webmanifest`} />
<link
rel="mask-icon"
href={`${baseUrl}/dantalion/favicons/safari-pinned-tab.svg`}
href={`${baseUrl}/favicons/safari-pinned-tab.svg`}
color="#374151"
/>
<link
rel="shortcut icon"
href={`${baseUrl}/dantalion/favicons/favicon.ico`}
/>
<link rel="shortcut icon" href={`${baseUrl}/favicons/favicon.ico`} />
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Component: VFC<Props> = ({
)}
<meta
name="msapplication-config"
content={`${baseUrl}/dantalion/favicons/browserconfig.xml`}
content={`${baseUrl}/favicons/browserconfig.xml`}
/>
</>
);
Expand Down

0 comments on commit 5b096f3

Please sign in to comment.