Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions client/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
import os from "node:os";

import isInsideContainer from "is-inside-container";
import removeImports from 'next-remove-imports';

const isWindowsDevContainer = () =>
os.release().toLowerCase().includes("microsoft") && isInsideContainer();

/** @type {import('next').NextConfig} */
const nextConfig = {
const baseConfig = {
reactStrictMode: true,
// dumb fix for windows docker
webpack: isWindowsDevContainer()
? (config) => {
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
};
return config;
}
: undefined,
webpack: (config, options) => {
if (isWindowsDevContainer()) {
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
};
}


config.module.rules.push({
test: /\.md$/,
use: 'raw-loader',
});

return config;
},
};

export default nextConfig;

const finalConfig = removeImports(baseConfig);

export default finalConfig;
Loading