mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
fix(frontend): use standalone output only in production build
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
045ba43c17
commit
33629b945d
2 changed files with 10 additions and 3 deletions
frontend
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
const { isMockMode, isTestMode } = require('./src/utils/test-modes')
|
const { isMockMode, isTestMode, isProductionMode} = require('./src/utils/test-modes')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
||||||
|
@ -86,7 +86,7 @@ const rawNextConfig = {
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
output: 'standalone',
|
output: isProductionMode ? 'standalone' : undefined,
|
||||||
swcMinify: false, //Otherwise emoji picker is minified incorrectly
|
swcMinify: false, //Otherwise emoji picker is minified incorrectly
|
||||||
experimental: {
|
experimental: {
|
||||||
outputFileTracingRoot: path.join(__dirname, '../')
|
outputFileTracingRoot: path.join(__dirname, '../')
|
||||||
|
|
|
@ -37,8 +37,15 @@ const isMockMode = !!process.env.NEXT_PUBLIC_USE_MOCK_API && isPositiveAnswer(pr
|
||||||
*/
|
*/
|
||||||
const isDevMode = process.env.NODE_ENV === 'development'
|
const isDevMode = process.env.NODE_ENV === 'development'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines if the current runtime was built in production mode.
|
||||||
|
* @type boolean
|
||||||
|
*/
|
||||||
|
const isProductionMode = process.env.NODE_ENV === 'production'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
isTestMode,
|
isTestMode,
|
||||||
isMockMode,
|
isMockMode,
|
||||||
isDevMode
|
isDevMode,
|
||||||
|
isProductionMode
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue