Socket
Socket
Sign inDemoInstall

webpack-blocks

Package Overview
Dependencies
675
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webpack-blocks

Convenience package that includes all the most common webpack blocks.


Version published
Maintainers
2
Created

Readme

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

FAQs

Last updated on 27 Apr 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc