chore(next): refactor nextjs config to mjs

remove husky
This commit is contained in:
xfy
2024-10-12 13:42:17 +08:00
parent 90da87d68e
commit f0b91cf14b
3 changed files with 9 additions and 13 deletions

View File

@ -1,5 +0,0 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
pnpm pretty-check
# pnpm lint

View File

@ -1,12 +1,13 @@
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
// import NextBundleAnalyzer from '@next/bundle-analyzer';
//
// const withBundleAnalyzer = NextBundleAnalyzer({
// enabled: process.env.ANALYZE === 'true',
// });
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
reactStrictMode: true,
swcMinify: true,
output: 'standalone',
@ -71,8 +72,9 @@ const KEYS_TO_OMIT = [
'assetPrefix',
];
module.exports = (_phase, { defaultConfig }) => {
const plugins = [[withBundleAnalyzer, {}]];
export default function finalConfig(_phase, { defaultConfig }) {
// const plugins = [[withBundleAnalyzer, {}]];
const plugins = [[(config) => config, {}]];
const wConfig = plugins.reduce(
(acc, [plugin, config]) => plugin({ ...acc, ...config }),
@ -90,4 +92,4 @@ module.exports = (_phase, { defaultConfig }) => {
});
return finalConfig;
};
}

View File

@ -59,7 +59,6 @@
"eslint-config-next": "14.2.7",
"file-loader": "^6.2.0",
"gray-matter": "^4.0.3",
"husky": "^9.1.6",
"leva": "^0.9.35",
"postcss": "^8.4.47",
"prettier": "^3.3.3",