1. webpack-blocks
Convenience package that includes all the most common webpack blocks.
webpack-blocks
Package: webpack-blocks
Created by: andywer
Last modified: Tue, 28 Jun 2022 23:41:00 GMT
Version: 2.1.0
License: MIT
Downloads: 1,388
Repository: https://github.com/andywer/webpack-blocks

Install

npm install webpack-blocks
yarn add webpack-blocks

webpack-blocks - the convenience package

Gitter chat
NPM Version

This is the webpack-blocks convenience package. It wraps all the most commonly used blocks, so you
can install just this single package and have webpack-blocks and your favorite blocks set up.

Usage

Here is a small sample configuration. Instead of requiring from @webpack-blocks/webpack,
@webpack-blocks/babel and others you just need a single require() and a single dependency in
your package.json.

Of course you can still separately define or install custom blocks and use them as you want.

 const webpack = require('webpack')
const {
  babel,
  createConfig,
  css,
  defineConstants,
  entryPoint,
  env,
  extractText,
  match,
  setOutput,
  uglify,
  postcss
} = require('webpack-blocks')
const cssnano = require('cssnano')

module.exports = createConfig([
  entryPoint('./src/main.js'),
  setOutput('./build/bundle.js'),
  babel(),
  defineConstants({
    'process.env.NODE_ENV': process.env.NODE_ENV
  }),
  match('*.css', { exclude: /node_modules/ }, [
    css(),
    env('production', [
      extractText(),
      postcss({
        plugins: [cssnano()]
      })
    ])
  ]),
  env('production', [uglify()])
])

Included blocks

webpack-blocks

Check out the

👉 Main documentation

Released under the terms of the MIT license.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code