webpack-atoms
raw JSON → 17.1.0 verified Sat Apr 25 auth: no javascript
Utility library providing small, composable helpers for crafting webpack 5+ configurations. Current stable version is 17.1.0, with active maintenance and frequent releases. Offers pre-built rule and plugin generators (e.g., rules.js(), plugins.uglify()) and atomic loaders (loaders.style(), loaders.file()), reducing boilerplate and configuration drift. Prioritizes webpack 5 compatibility and lightweight abstraction over full-featured config tools like webpack-merge or webpack-blocks.
Common errors
error Cannot find module 'webpack-atoms' ↓
cause Package not installed or not in node_modules.
fix
Run 'npm install webpack-atoms'
Warnings
breaking Version 15.0.0 dropped support for webpack 4; use webpack-atoms@14 for webpack 4 compatibility. ↓
fix Upgrade to webpack 5 or pin to webpack-atoms@14.
Install
npm install webpack-atoms yarn add webpack-atoms pnpm add webpack-atoms Imports
- rules
const { rules } = require('webpack-atoms') - plugins
const { plugins } = require('webpack-atoms') - loaders
const { loaders } = require('webpack-atoms')
Quickstart
const { rules, plugins, loaders } = require('webpack-atoms');
module.exports = {
entry: './src/app.js',
output: { filename: 'bundle.js', path: __dirname + '/dist' },
module: {
rules: [
rules.js(),
rules.images(),
rules.css(),
],
},
plugins: [
plugins.uglify(),
plugins.loaderOptions(),
plugins.extractText(),
],
};