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

187
Views
How to add Webpack to a project for strictly minification?

I am a dev on a web application that consists of Java Server Pages which act as the HTML, a Java backend, and Javascript front-end files. I have been tasked with looking into adding Webpack to the project, with the goal of only using it to minify Javascript files at first (eventually we will use more of Webpack's features of course). I have tried doing research via Google into Webpack minification, but I am having trouble finding anything detailing how to use it for just minification, instead of bundling the project files.

Does anyone know how to use Webpack for strictly Javscript minification?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Webpack out of the box is anticipating on processing JS and will run minification on production builds by default.

https://webpack.js.org/configuration/mode/ (different build modes)

Assuming you are already past configuring a JS entry file to consume all your JS files: https://webpack.js.org/configuration/entry-context/#entry

AND configured a loader on how to handle each JS file imported in your entry file appropriately. (Feels like you want asset/resource. Pay close attention to asset modules type and generator options) https://webpack.js.org/guides/asset-modules/

The settings for minification on a production build are what is known as the optimization.minimize configuration of your webpack.

https://webpack.js.org/configuration/optimization/#optimizationminimize

With Webpack5, further options around the minification engine has been exposed and is known as optimization.minimizer configuration options: https://webpack.js.org/configuration/optimization/#optimizationminimizer

about 4 years ago · Juan Pablo Isaza Report
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!