chore: revert back code

This commit is contained in:
hardfist 2024-07-21 18:29:06 +08:00
parent 03eba8f996
commit 783c32024e
2 changed files with 26 additions and 15 deletions

View file

@ -0,0 +1,11 @@
// @ts-check
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: "export",
};
module.exports = nextConfig;

View file

@ -2266,22 +2266,22 @@ export default async function getBaseWebpackConfig(
const webpack5Config = webpackConfig as webpack.Configuration
// disable lazy compilation of entries as next.js has it's own method here
// if (webpack5Config.experiments?.lazyCompilation === true) {
// webpack5Config.experiments.lazyCompilation = {
// entries: false,
// }
// } else if (
// typeof webpack5Config.experiments?.lazyCompilation === 'object' &&
// webpack5Config.experiments.lazyCompilation.entries !== false
// ) {
// webpack5Config.experiments.lazyCompilation.entries = false
// }
if (webpack5Config.experiments?.lazyCompilation === true) {
webpack5Config.experiments.lazyCompilation = {
entries: false,
}
} else if (
typeof webpack5Config.experiments?.lazyCompilation === 'object' &&
webpack5Config.experiments.lazyCompilation.entries !== false
) {
webpack5Config.experiments.lazyCompilation.entries = false
}
// if (typeof (webpackConfig as any).then === 'function') {
// console.warn(
// '> Promise returned in next config. https://nextjs.org/docs/messages/promise-in-next-config'
// )
// }
if (typeof (webpackConfig as any).then === 'function') {
console.warn(
'> Promise returned in next config. https://nextjs.org/docs/messages/promise-in-next-config'
)
}
}
const rules = webpackConfig.module?.rules || []