uchill/front_minimal/next.config.mjs

41 lines
955 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const isStaticExport = 'false';
const nextConfig = {
trailingSlash: true,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
env: {
BUILD_STATIC_EXPORT: isStaticExport,
},
modularizeImports: {
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
'@mui/material': {
transform: '@mui/material/{{member}}',
},
'@mui/lab': {
transform: '@mui/lab/{{member}}',
},
},
webpack(config, { dev }) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
// В Docker: меньше нагрузка на память при file watching
if (dev) {
config.watchOptions = {
ignored: ['**/node_modules/**', '**/.git/**', '**/.next/**', '**/out/**'],
aggregateTimeout: 300,
poll: 1000,
};
}
return config;
},
...(isStaticExport === 'true' && {
output: 'export',
}),
};
export default nextConfig;