feat(core): open in app for self-hosted (#9231)

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/545994dd-6f7d-468d-a90c-45cb382fdb9d.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/545994dd-6f7d-468d-a90c-45cb382fdb9d.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/545994dd-6f7d-468d-a90c-45cb382fdb9d.mp4">20241222-1456-24.5006677.mp4</video>

fix AF-1815
This commit is contained in:
pengx17
2024-12-24 03:04:01 +00:00
parent 884bbd2ada
commit 17c2293986
14 changed files with 140 additions and 43 deletions

View File

@@ -360,7 +360,18 @@ export const createConfiguration: (
client: {
overlay: process.env.DISABLE_DEV_OVERLAY === 'true' ? false : undefined,
},
historyApiFallback: true,
historyApiFallback: {
rewrites: [
{
from: /.*/,
to: () => {
return process.env.SELF_HOSTED === 'true'
? '/selfhost.html'
: '/index.html';
},
},
],
},
static: [
{
directory: join(

View File

@@ -22,7 +22,6 @@ export function getBuildConfig(buildFlags: BuildFlags): BUILD_CONFIG_TYPE {
isAndroid: buildFlags.distribution === 'android',
isAdmin: buildFlags.distribution === 'admin',
isSelfHosted: process.env.SELF_HOSTED === 'true',
appBuildType: 'stable' as const,
serverUrlPrefix: 'https://app.affine.pro',
appVersion: packageJson.version,