šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

webpack-blocks

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-blocks

Convenience package that includes all the most common webpack blocks.

2.1.0
latest
Source
npm
Version published
Weekly downloads
314
-92.99%
Maintainers
2
Weekly downloads
Ā 
Created
Source

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.

Keywords

webpack

FAQs

Package last updated on 27 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts