mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
fix(frontend): use swc minify to prevent terser error
Terser can't handle the static blocks our code produce. SWC can handle this, but causes other problems caused by the global-error files. It's not a nice solution but the benefit is bigger than the risk. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
a386faa2d8
commit
6760db9e18
3 changed files with 1 additions and 85 deletions
|
@ -95,7 +95,7 @@ const rawNextConfig = {
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
swcMinify: false, //Otherwise emoji picker is minified incorrectly
|
swcMinify: true,
|
||||||
experimental: {
|
experimental: {
|
||||||
outputFileTracingRoot: path.join(__dirname, '../')
|
outputFileTracingRoot: path.join(__dirname, '../')
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
'use client'
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
import { UiIcon } from '../../components/common/icons/ui-icon'
|
|
||||||
import { ExternalLink } from '../../components/common/links/external-link'
|
|
||||||
import links from '../../links.json'
|
|
||||||
import React, { useEffect } from 'react'
|
|
||||||
import { Button, Container } from 'react-bootstrap'
|
|
||||||
import { ArrowRepeat as IconArrowRepeat } from 'react-bootstrap-icons'
|
|
||||||
|
|
||||||
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
|
|
||||||
useEffect(() => {
|
|
||||||
console.error(error)
|
|
||||||
}, [error])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<Container className='d-flex flex-column mvh-100'>
|
|
||||||
<div className='d-flex flex-column align-items-center justify-content-center my-5'>
|
|
||||||
<h1>An unknown error occurred</h1>
|
|
||||||
<p>
|
|
||||||
Don't worry, this happens sometimes. If this is the first time you see this page then try reloading
|
|
||||||
the app.
|
|
||||||
</p>
|
|
||||||
If you can reproduce this error, then we would be glad if you{' '}
|
|
||||||
<ExternalLink text={'open an issue on github'} href={links.issues} className={'text-primary'} /> or{' '}
|
|
||||||
<ExternalLink text={'contact us on matrix.'} href={links.chat} className={'text-primary'} />
|
|
||||||
<Button onClick={reset} title={'Reload App'} className={'mt-4'}>
|
|
||||||
<UiIcon icon={IconArrowRepeat} />
|
|
||||||
Reload App
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</Container>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
'use client'
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
import { UiIcon } from '../../components/common/icons/ui-icon'
|
|
||||||
import { ExternalLink } from '../../components/common/links/external-link'
|
|
||||||
import links from '../../links.json'
|
|
||||||
import React, { useEffect } from 'react'
|
|
||||||
import { Button, Container } from 'react-bootstrap'
|
|
||||||
import { ArrowRepeat as IconArrowRepeat } from 'react-bootstrap-icons'
|
|
||||||
|
|
||||||
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
|
|
||||||
useEffect(() => {
|
|
||||||
console.error(error)
|
|
||||||
}, [error])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<Container className='d-flex flex-column mvh-100'>
|
|
||||||
<div className='d-flex flex-column align-items-center justify-content-center my-5'>
|
|
||||||
<h1>An unknown error occurred</h1>
|
|
||||||
<p>
|
|
||||||
Don't worry, this happens sometimes. If this is the first time you see this page then try reloading
|
|
||||||
the app.
|
|
||||||
</p>
|
|
||||||
If you can reproduce this error, then we would be glad if you 
|
|
||||||
<ExternalLink text={'open an issue on github'} href={links.issues} className={'text-primary'} />
|
|
||||||
  or <ExternalLink text={'contact us on matrix.'} href={links.chat} className={'text-primary'} />
|
|
||||||
<Button onClick={reset} title={'Reload App'} className={'mt-4'}>
|
|
||||||
<UiIcon icon={IconArrowRepeat} />
|
|
||||||
Reload App
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</Container>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
)
|
|
||||||
}
|
|
Loading…
Reference in a new issue