Skip to content

Commit

Permalink
chore(ui): remove deprecated image-webpack-loader (#18923)
Browse files Browse the repository at this point in the history
* remove gif support

* remove image-webpack-loader

* do not print file name to save build time
  • Loading branch information
chirag-madlani authored Dec 4, 2024
1 parent fb9bd00 commit 94e3b54
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1,098 deletions.
2 changes: 0 additions & 2 deletions openmetadata-ui/src/main/resources/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,9 @@
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "6.5.0",
"fs-extra": "^10.1.0",
"gifsicle": "^7.0.1",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.1",
"i18next-json-sync": "^3.1.2",
"image-webpack-loader": "^8.1.0",
"jest": "^26.6.3",
"jest-sonar-reporter": "^2.0.0",
"less-loader": "^11.0.0",
Expand Down
19 changes: 3 additions & 16 deletions openmetadata-ui/src/main/resources/ui/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,13 @@ module.exports = {

// Images to be handled by file-loader + image-webpack-loader
{
test: /\.(png|jpe?g|gif)$/i,
test: /\.(png|jpe?g)$/i,
use: [
{
loader: 'file-loader',
options: {
name: 'images/[name].[contenthash].[ext]', // Output file naming
outputPath: 'images/', // Directory in the output folder
publicPath: '/', // Public path used in the app
},
},
{
loader: 'image-webpack-loader',
options: {
mozjpeg: { progressive: true, quality: 75 },
optipng: { enabled: false },
pngquant: { quality: [0.65, 0.9], speed: 4 },
gifsicle: { interlaced: false },
webp: { quality: 75 }, // Modern image format support
},
},
],
Expand Down Expand Up @@ -188,9 +177,7 @@ module.exports = {
// Plugins
plugins: [
// Clean webpack output directory
new CleanWebpackPlugin({
verbose: true, // Log removed files
}),
new CleanWebpackPlugin(),

// Generate index.html from template
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -262,4 +249,4 @@ module.exports = {

// Disable source maps for production
devtool: false,
};
};
Loading

0 comments on commit 94e3b54

Please sign in to comment.