Compare commits
2 Commits
1fd6ed85b6
...
a68d912c99
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a68d912c99 | ||
|
|
d3998133e5 |
@@ -132,6 +132,8 @@ class Images extends Component {
|
||||
component="img"
|
||||
height="400"
|
||||
image={getImagePath(this.props.pictureList)}
|
||||
fetchPriority="high"
|
||||
loading="eager"
|
||||
sx={{
|
||||
objectFit: 'contain',
|
||||
cursor: 'pointer',
|
||||
@@ -170,6 +172,8 @@ class Images extends Component {
|
||||
<CardMedia
|
||||
component="img"
|
||||
height="400"
|
||||
fetchPriority="high"
|
||||
loading="eager"
|
||||
sx={{
|
||||
objectFit: 'contain',
|
||||
cursor: 'pointer',
|
||||
|
||||
@@ -8,10 +8,8 @@ import {
|
||||
Grid,
|
||||
Alert
|
||||
} from '@mui/material';
|
||||
import {
|
||||
Delete,
|
||||
CloudUpload
|
||||
} from '@mui/icons-material';
|
||||
import Delete from '@mui/icons-material/Delete';
|
||||
import CloudUpload from '@mui/icons-material/CloudUpload';
|
||||
|
||||
class PhotoUpload extends Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -306,6 +306,8 @@ class Product extends Component {
|
||||
height={ window.innerWidth < 600 ? "240" : "180" }
|
||||
image="/assets/images/nopicture.jpg"
|
||||
alt={name}
|
||||
fetchPriority={this.props.priority === 'high' ? 'high' : 'auto'}
|
||||
loading={this.props.priority === 'high' ? 'eager' : 'lazy'}
|
||||
sx={{
|
||||
objectFit: 'contain',
|
||||
borderTopLeftRadius: '8px',
|
||||
@@ -319,6 +321,8 @@ class Product extends Component {
|
||||
height={ window.innerWidth < 600 ? "240" : "180" }
|
||||
image={this.state.image}
|
||||
alt={name}
|
||||
fetchPriority={this.props.priority === 'high' ? 'high' : 'auto'}
|
||||
loading={this.props.priority === 'high' ? 'eager' : 'lazy'}
|
||||
sx={{
|
||||
objectFit: 'contain',
|
||||
borderTopLeftRadius: '8px',
|
||||
|
||||
@@ -31,6 +31,8 @@ const ProductImage = ({
|
||||
height="400"
|
||||
image="/assets/images/nopicture.jpg"
|
||||
alt={product.name}
|
||||
fetchPriority="high"
|
||||
loading="eager"
|
||||
sx={{ objectFit: "cover" }}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -476,6 +476,7 @@ class ProductList extends Component {
|
||||
pictureList={product.pictureList}
|
||||
availableSupplier={product.availableSupplier}
|
||||
komponenten={product.komponenten}
|
||||
priority={index < 6 ? 'high' : 'auto'}
|
||||
t={this.props.t}
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
IconButton,
|
||||
Snackbar
|
||||
} from '@mui/material';
|
||||
import { ContentCopy } from '@mui/icons-material';
|
||||
import ContentCopy from '@mui/icons-material/ContentCopy';
|
||||
import { withI18n } from '../../i18n/withTranslation.js';
|
||||
|
||||
class SettingsTab extends Component {
|
||||
|
||||
@@ -11,9 +11,7 @@ import {
|
||||
ListItemText,
|
||||
ListItemSecondaryAction,
|
||||
} from '@mui/material';
|
||||
import {
|
||||
ShoppingCart as ShoppingCartIcon,
|
||||
} from '@mui/icons-material';
|
||||
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
|
||||
import { TentShapeSelector, ProductSelector, ExtrasSelector } from '../components/configurator/index.js';
|
||||
import { tentShapes, tentSizes, lightTypes, ventilationTypes, extras } from '../data/configuratorData.js';
|
||||
|
||||
|
||||
@@ -64,12 +64,20 @@ class GitHashJsonPlugin {
|
||||
const CopyAssetsPlugin = {
|
||||
apply: (compiler) => {
|
||||
compiler.hooks.afterEmit.tap('CopyAssetsPlugin', () => {
|
||||
// Copy assets directory
|
||||
// Copy assets directory but exclude fonts (webpack handles fonts with hashed names)
|
||||
const assetsSrc = path.resolve(__dirname, 'public/assets');
|
||||
const assetsDest = path.resolve(__dirname, 'dist/assets');
|
||||
try {
|
||||
cpSync(assetsSrc, assetsDest, { recursive: true });
|
||||
console.log('Assets copied successfully');
|
||||
// Copy all assets except fonts
|
||||
const items = fs.readdirSync(assetsSrc);
|
||||
for (const item of items) {
|
||||
if (item !== 'fonts') {
|
||||
const srcPath = path.join(assetsSrc, item);
|
||||
const destPath = path.join(assetsDest, item);
|
||||
cpSync(srcPath, destPath, { recursive: true });
|
||||
}
|
||||
}
|
||||
console.log('Assets copied successfully (fonts excluded - handled by webpack)');
|
||||
} catch (err) {
|
||||
console.error('Error copying assets:', err);
|
||||
}
|
||||
@@ -215,7 +223,7 @@ export default {
|
||||
},
|
||||
// Split commonly used MUI icons (used in main bundle and immediate-loading components)
|
||||
muiIconsCommon: {
|
||||
test: /[\\/]node_modules[\\/]@mui[\\/]icons-material[\\/].*(SmartToy|Palette|Search|Home|ShoppingCart|Close|ChevronLeft|ChevronRight|Person|Google|Add|Remove|Delete|KeyboardArrowUp|ZoomIn|Loupe|ExpandMore|ExpandLess|Mic|Stop|PhotoCamera).*\.js$/,
|
||||
test: /[\\/]node_modules[\\/]@mui[\\/]icons-material[\\/].*(SmartToy|Palette|Search|Home|ShoppingCart|Close|ChevronLeft|ChevronRight|Person|Google|Add|Remove|Delete|KeyboardArrowUp|ZoomIn|Loupe|ExpandMore|ExpandLess|Mic|Stop|PhotoCamera|Menu|KeyboardReturn|ContentCopy|Cancel|CloudUpload|Star).*\.js$/,
|
||||
name: 'mui-icons-common',
|
||||
priority: 29,
|
||||
reuseExistingChunk: true,
|
||||
@@ -223,7 +231,7 @@ export default {
|
||||
},
|
||||
// Split remaining MUI icons into separate chunk (for lazy-loaded components only)
|
||||
muiIcons: {
|
||||
test: /[\\/]node_modules[\\/]@mui[\\/]icons-material[\\/]/,
|
||||
test: /[\\/]node_modules[\\/]@mui[\\/]icons-material[\\/].*(Article|LockReset|AdminPanelSettings|Group|BarChart).*\.js$/,
|
||||
name: 'mui-icons',
|
||||
priority: 28,
|
||||
reuseExistingChunk: true,
|
||||
|
||||
Reference in New Issue
Block a user