mirror of
https://github.com/Cola-Echo/memory-manager-concurrent.git
synced 2026-06-06 01:55:51 +00:00
主要更新: - 总结世界书并发拆分功能(自动检测约5万字拆分为Part) - Part调试面板 - Amily表格并发填充模块(src/table-filler/) - 合并去重开关 - 内置默认独立模板 - 多主题支持优化 - 添加.gitignore排除不必要文件 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
65 lines
2.0 KiB
JavaScript
65 lines
2.0 KiB
JavaScript
const path = require('path');
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
module.exports = (env, argv) => {
|
|
const isProduction = argv.mode === 'production';
|
|
|
|
return {
|
|
entry: './src/index.js',
|
|
|
|
output: {
|
|
filename: 'index.js',
|
|
path: path.resolve(__dirname, 'dist'),
|
|
iife: true,
|
|
clean: true,
|
|
},
|
|
|
|
optimization: {
|
|
minimize: isProduction,
|
|
minimizer: [
|
|
new TerserPlugin({
|
|
terserOptions: {
|
|
format: {
|
|
comments: false,
|
|
},
|
|
compress: {
|
|
drop_console: false,
|
|
drop_debugger: true,
|
|
},
|
|
},
|
|
extractComments: false,
|
|
}),
|
|
],
|
|
},
|
|
|
|
devtool: isProduction ? false : 'inline-source-map',
|
|
|
|
watchOptions: {
|
|
ignored: /node_modules/,
|
|
aggregateTimeout: 300,
|
|
},
|
|
|
|
performance: {
|
|
hints: isProduction ? 'warning' : false,
|
|
maxEntrypointSize: 512000,
|
|
maxAssetSize: 512000,
|
|
},
|
|
|
|
resolve: {
|
|
extensions: ['.js'],
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
'@core': path.resolve(__dirname, 'src/core'),
|
|
'@config': path.resolve(__dirname, 'src/config'),
|
|
'@worldbook': path.resolve(__dirname, 'src/worldbook'),
|
|
'@api': path.resolve(__dirname, 'src/api'),
|
|
'@memory': path.resolve(__dirname, 'src/memory'),
|
|
'@hooks': path.resolve(__dirname, 'src/hooks'),
|
|
'@ui': path.resolve(__dirname, 'src/ui'),
|
|
'@utils': path.resolve(__dirname, 'src/utils'),
|
|
'@table-filler': path.resolve(__dirname, 'src/table-filler'),
|
|
}
|
|
},
|
|
};
|
|
};
|