mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
feat(core): add global error handler (#8509)
This commit is contained in:
@@ -5,6 +5,11 @@ function testPackageName(regexp: RegExp): (module: any) => boolean {
|
||||
|
||||
// https://hackernoon.com/the-100-correct-way-to-split-your-chunks-with-webpack-f8a9df5b7758
|
||||
export const productionCacheGroups = {
|
||||
errorHandler: {
|
||||
test: /global-error-handler/,
|
||||
priority: 1000,
|
||||
enforce: true,
|
||||
},
|
||||
asyncVendor: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name(module: any) {
|
||||
|
||||
@@ -56,13 +56,7 @@ const OptimizeOptionOptions: (
|
||||
minChunks: 1,
|
||||
maxInitialRequests: Number.MAX_SAFE_INTEGER,
|
||||
maxAsyncRequests: Number.MAX_SAFE_INTEGER,
|
||||
cacheGroups:
|
||||
buildFlags.mode === 'production'
|
||||
? productionCacheGroups
|
||||
: {
|
||||
default: false,
|
||||
vendors: false,
|
||||
},
|
||||
cacheGroups: productionCacheGroups,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -404,6 +398,11 @@ export const createConfiguration: (
|
||||
maxInitialRequests: Infinity,
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
errorHandler: {
|
||||
test: /global-error-handler/,
|
||||
priority: 1000,
|
||||
enforce: true,
|
||||
},
|
||||
defaultVendors: {
|
||||
test: `[\\/]node_modules[\\/](?!.*vanilla-extract)`,
|
||||
priority: -10,
|
||||
|
||||
Reference in New Issue
Block a user