Weboptimizer is a comprehensive web optimization and module bundling solution, acting as a highly configurable wrapper around Webpack 5+. The current stable version is 3.0.21, with an active release cadence focusing on ongoing development and maintenance. It aims to streamline the development workflow by providing preconfigured support for various web technologies, including HTML, CSS (via PostCSS), JavaScript (via Babel and Flow), and templating (via EJS), handling both preprocessing and postprocessing (minification, image compression). A key differentiator is its emphasis on consolidating configuration within the `package.json` file, aiming to simplify setup compared to traditional, extensive Webpack configurations. It supports building for both library and web targets out of the box and includes features like automatic image sprite generation, providing a robust environment for web-related or Node.js projects.
npm install weboptimizerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to generate a Webpack configuration using weboptimizer, showcasing its role as a high-level wrapper that can leverage `package.json` for primary configuration.
Upgrade your Node.js environment to version 24 or newer (e.g., `nvm install 24 && nvm use 24`).
Ensure your project's `webpack` and related core plugins are updated to version 5 or higher.
Install all required peer dependencies using `npm install [list-of-peer-dependencies]` to ensure full functionality and avoid 'module not found' errors.
Familiarize yourself with the `weboptimizer` documentation on `package.json` configuration to understand how to customize its behavior. Use the `webpack.config.ts` primarily for advanced overrides or conditional logic.
Review the full license text at `https://creativecommons.org/licenses/by/3.0/deed.de` to ensure compliance with its terms, especially regarding attribution.
Install the missing peer dependencies: `npm install webpack webpack-cli webpack-dev-server` (add others as indicated by your specific build output).
Update your Webpack configuration files (`webpack.config.js` or `webpack.config.ts`) to use `import` statements. Ensure your project and Node.js environment are configured for ES Modules.
Upgrade your Node.js installation to version 24 or higher. Tools like NVM (Node Version Manager) can help: `nvm install 24 && nvm use 24`.