diff options
Diffstat (limited to 'opendc-web/opendc-web-ui/next.config.js')
| -rw-r--r-- | opendc-web/opendc-web-ui/next.config.js | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/opendc-web/opendc-web-ui/next.config.js b/opendc-web/opendc-web-ui/next.config.js index 1dfe4156..d8029108 100644 --- a/opendc-web/opendc-web-ui/next.config.js +++ b/opendc-web/opendc-web-ui/next.config.js @@ -22,39 +22,24 @@ // PatternFly 4 uses global CSS imports in its distribution files. Therefore, // we need to transpile the modules before we can use them. -const withTM = require('next-transpile-modules')([ - '@patternfly/react-core', - '@patternfly/react-styles', - '@patternfly/react-table', - '@patternfly/react-tokens', -]) +const { withGlobalCss } = require('next-global-css') +const { PHASE_DEVELOPMENT_SERVER } = require("next/constants"); +const withConfig = withGlobalCss() -module.exports = withTM({ +module.exports = (phase) => withConfig({ + basePath: process.env.NEXT_BASE_PATH && '/' + process.env.NEXT_BASE_PATH, reactStrictMode: true, experimental: { - eslint: true, + eslint: true }, + distDir: phase === PHASE_DEVELOPMENT_SERVER ? 'build/next-dev' : 'build/next', async redirects() { return [ { source: '/', destination: '/projects', - permanent: true, - }, - ] - }, - webpack: (config, options) => { - if (options.dev) { - config.optimization.splitChunks = { - cacheGroups: { - vendor: { - test: /[\\/]node_modules[\\/]/, - name: 'transpiled-modules', - chunks: 'all', - }, - }, + permanent: true } - } - return config + ] } }) |
