From 6cf097b60366ecb2116f742be4374fcec841a950 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 18 Mar 2022 13:34:09 +0100 Subject: build(web/ui): Support building WebJar for OpenDC web UI This change updates the build process to build a static WebJar out of the OpenDC web UI module. This allows us to embed the UI inside the development distribution of OpenDC for other users to readily deploy it. --- opendc-web/opendc-web-ui/next.config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'opendc-web/opendc-web-ui/next.config.js') diff --git a/opendc-web/opendc-web-ui/next.config.js b/opendc-web/opendc-web-ui/next.config.js index 59341b1f..d8029108 100644 --- a/opendc-web/opendc-web-ui/next.config.js +++ b/opendc-web/opendc-web-ui/next.config.js @@ -23,14 +23,16 @@ // PatternFly 4 uses global CSS imports in its distribution files. Therefore, // we need to transpile the modules before we can use them. const { withGlobalCss } = require('next-global-css') +const { PHASE_DEVELOPMENT_SERVER } = require("next/constants"); const withConfig = withGlobalCss() -module.exports = withConfig({ +module.exports = (phase) => withConfig({ + basePath: process.env.NEXT_BASE_PATH && '/' + process.env.NEXT_BASE_PATH, reactStrictMode: true, experimental: { eslint: true }, - distDir: 'build/next', + distDir: phase === PHASE_DEVELOPMENT_SERVER ? 'build/next-dev' : 'build/next', async redirects() { return [ { -- cgit v1.2.3