pref: 添加配置文件

This commit is contained in:
zdl
2025-11-17 19:21:17 +08:00
parent 678eb6838e
commit 8914a46c40

View File

@@ -69,7 +69,7 @@ module.exports = {
},
// 日期/日历库
calendar: {
test: /[\\/]node_modules[\\/](moment|date-fns|@fullcalendar|react-big-calendar)[\\/]/,
test: /[\\/]node_modules[\\/](dayjs|date-fns|@fullcalendar|react-big-calendar)[\\/]/,
name: 'calendar-lib',
priority: 18,
reuseExistingChunk: true,
@@ -161,13 +161,8 @@ module.exports = {
);
}
// 忽略 moment 的语言包(如果项目使用了 moment
webpackConfig.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment$/,
})
);
// Day.js 的语言包非常小(每个约 0.5KB),所以不需要特别忽略
// 如果需要优化,可以只导入需要的语言包
// ============== Loader 优化 ==============
const babelLoaderRule = webpackConfig.module.rules.find(