Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

70
Views
Webpack5 cómo minimizar la copia de activos como imágenes

Tengo el siguiente archivo webpack.config.js , desde esta configuración logré comprimir todas las imágenes que se consumen de los archivos css.

Pero también quiero comprimir todas las imágenes que estoy copiando en la carpeta dist.

 const CopyPlugin = require("copy-webpack-plugin"); module.exports = { module: { rules: [ { test: /\.css$/i, use: ['style-loader', 'css-loader'], }, { test: /\.(gif|png|jpe?g|svg)$/i, use: [ 'file-loader', { loader: 'image-webpack-loader', options: { mozjpeg: { progressive: true, }, // optipng.enabled: false will disable optipng optipng: { enabled: false, }, pngquant: { quality: [0.65, 0.90], speed: 4 }, gifsicle: { interlaced: false, }, // the webp option will enable WEBP webp: { quality: 75 } } }, ], } ], }, plugins: [ // copying static assets to dist directory, i want these images to be compressed as well new CopyPlugin({ patterns: [{ from: "source/images", to: "images" } ], }) ]};

¿Cómo puedo lograr esto en webpack 5?

Vi este buen artículo ( https://web.dev/codelab-imagemin-webpack/ ) que explica cómo se puede lograr esto, pero parece que imagemin-webpack-plugin no se actualizó recientemente.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!