u
This commit is contained in:
@@ -10,6 +10,7 @@ import CategoryPickerDialog from '../../components/article/CategoryPickerDialog'
|
|||||||
import { NewCategoryTile, CategoryBreadcrumbs } from '../../components/category';
|
import { NewCategoryTile, CategoryBreadcrumbs } from '../../components/category';
|
||||||
import { NewArticleTile } from '../../components/article';
|
import { NewArticleTile } from '../../components/article';
|
||||||
import { notifyError } from '../../utils/notify';
|
import { notifyError } from '../../utils/notify';
|
||||||
|
import { prepareArticlePhoto } from '../../utils/prepareArticlePhoto';
|
||||||
import {
|
import {
|
||||||
ArticleTile,
|
ArticleTile,
|
||||||
BackTile,
|
BackTile,
|
||||||
@@ -440,7 +441,6 @@ class ArtikelKategorienPage extends PureComponent {
|
|||||||
const file = e.target.files?.[0];
|
const file = e.target.files?.[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
try {
|
try {
|
||||||
const { prepareArticlePhoto } = await import('../../utils/prepareArticlePhoto');
|
|
||||||
const avifFile = await prepareArticlePhoto(file);
|
const avifFile = await prepareArticlePhoto(file);
|
||||||
await categoryAutomat.actions.uploadCategoryImage({
|
await categoryAutomat.actions.uploadCategoryImage({
|
||||||
categoryId: item.id,
|
categoryId: item.id,
|
||||||
|
|||||||
@@ -162,24 +162,62 @@ export default defineConfig(({ command }) => ({
|
|||||||
output: {
|
output: {
|
||||||
codeSplitting: {
|
codeSplitting: {
|
||||||
groups: [
|
groups: [
|
||||||
|
// Split the lazy routes into a handful of per-section chunks
|
||||||
|
// (not one tiny chunk per route). Each section chunk groups the
|
||||||
|
// section's pages together with the component trees used only by
|
||||||
|
// that section, so first navigation to /artikel, /auftrag, …
|
||||||
|
// loads just that section's code. Modules shared across sections
|
||||||
|
// (api/, automats/, utils/, generic components/) fall out into a
|
||||||
|
// common chunk by the bundler automatically.
|
||||||
{
|
{
|
||||||
// Consolidate every lazy(() => import('./pages/...')) route
|
// Artikel section: pages + its dedicated component trees.
|
||||||
// module into ONE chunk so we don't ship ~30 tiny 0.1–0.4 kB
|
name: 'routes-artikel',
|
||||||
// files. Still loaded on first route navigation (not on the
|
test: /\/src\/(pages\/artikel|components\/(article|category|tiles))\//,
|
||||||
// initial bundle). For per-section chunks instead, replace this
|
|
||||||
// with groups matching /\/src\/pages\/(artikel|lieferung|...)\//.
|
|
||||||
name: 'routes',
|
|
||||||
test: /\/src\/pages\//,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// Delivery + order (auftrag) editor surfaces share these.
|
||||||
|
name: 'routes-manifest',
|
||||||
|
test: /\/src\/components\/manifest\//,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'routes-auftrag',
|
||||||
|
test: /\/src\/pages\/auftrag\//,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'routes-lieferung',
|
||||||
|
test: /\/src\/pages\/lieferung\//,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'routes-kunde',
|
||||||
|
test: /\/src\/pages\/kunde\//,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority: 110,
|
||||||
|
name: 'router-vendor',
|
||||||
|
test: /node_modules\/(react-router|react-router-dom)\//,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority: 100,
|
||||||
name: 'react-vendor',
|
name: 'react-vendor',
|
||||||
test: /node_modules\/(react|react-dom|react-router|react-router-dom|scheduler)\//,
|
test: /node_modules\/(react|react-dom|scheduler)\//,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
priority: 110,
|
||||||
|
name: 'mui-icons',
|
||||||
|
test: /node_modules\/@mui\/icons-material\//,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority: 105,
|
||||||
|
name: 'emotion-vendor',
|
||||||
|
test: /node_modules\/@emotion\//,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority: 100,
|
||||||
name: 'mui-vendor',
|
name: 'mui-vendor',
|
||||||
test: /node_modules\/(@mui|@emotion)\//,
|
test: /node_modules\/@mui\//,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
priority: 100,
|
||||||
name: 'jsquash-image',
|
name: 'jsquash-image',
|
||||||
test: /node_modules\/@jsquash\/(avif|resize)\//,
|
test: /node_modules\/@jsquash\/(avif|resize)\//,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user