Webpack Production Setup
This package, `webpack-production-setup`, provides a pre-configured Webpack 2 build pipeline aimed at production performance and simplicity. Despite its `5.0.0` version, the documentation explicitly states it targets Webpack 2, making it severely outdated for current Webpack versions (5+). It abstracts common configurations for ES6, Babel, and Sass bundling into a reusable `webpack.config.js` file that can be required and optionally mutated. Its stated focus is on ease of use and optimized output. Given the dependency on Webpack 2 and the last commit dating back to 2017, it is not actively maintained for modern Webpack environments and has not seen recent updates to align with current ecosystem best practices or Webpack 5 features.
Warnings
- breaking This package is explicitly built for Webpack 2. Attempting to use it with modern Webpack versions (3, 4, 5, or later) will result in significant configuration errors, breaking changes in plugins, and build failures due to API incompatibilities.
- gotcha The README itself warns that the setup 'might not work everywhere'. This indicates that even within its intended Webpack 2 environment, it may not be robust enough for diverse project structures or specific use cases.
- breaking The package lists extremely old Node.js (`>=5.4.1`) and npm (`>=3.3.12`) engine requirements. Using this package with modern Node.js or npm versions may lead to unexpected behavior, compatibility issues, and potentially security vulnerabilities.
Install
-
npm install webpack-production-setup -
yarn add webpack-production-setup -
pnpm add webpack-production-setup
Imports
- webpack.config.js
import wppsConfig from 'webpack-production-setup/webpack.config.js';
const wppsConfig = require('webpack-production-setup/webpack.config.js');
Quickstart
const wppsConfig = require('webpack-production-setup/webpack.config.js');
// Optionally, mutate the configuration provided by the package
wppsConfig.plugins.push(/* my own plugins here, e.g., new SomeWebpackPlugin() */);
wppsConfig.devtool = 'cheap-module-eval-source-map'; // Example of overriding devtool
module.exports = wppsConfig;