feat: improve admin panel (#14180)

This commit is contained in:
DarkSky
2025-12-30 05:22:54 +08:00
committed by GitHub
parent d6b380aee5
commit 95a5e941e7
94 changed files with 3146 additions and 1114 deletions

View File

@@ -510,6 +510,7 @@ export function createNodeTargetConfig(
pkg: Package,
entry: string
): Omit<webpack.Configuration, 'name'> & { name: string } {
const buildConfig = getBuildConfigFromEnv(pkg);
return {
name: entry,
context: ProjectRoot.value,
@@ -541,7 +542,7 @@ export function createNodeTargetConfig(
},
externalsPresets: { node: true },
node: { __dirname: false, __filename: false },
mode: 'none',
mode: buildConfig.debug ? 'development' : 'production',
devtool: 'source-map',
resolve: {
symlinks: true,
@@ -617,7 +618,22 @@ export function createNodeTargetConfig(
}),
]),
stats: { errorDetails: true },
optimization: { nodeEnv: false },
optimization: {
nodeEnv: false,
minimize: !buildConfig.debug,
minimizer: [
new TerserPlugin({
minify: TerserPlugin.swcMinify,
parallel: true,
extractComments: true,
terserOptions: {
ecma: 2020,
compress: { unused: true },
mangle: { keep_classnames: true },
},
}),
],
},
performance: { hints: false },
ignoreWarnings: [/^(?!CriticalDependenciesWarning$)/],
};