New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webpack-parts

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-parts

Build your webpack config from composable and opinionated parts

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

DEPRECATION NOTICE

webpack-parts was created before we knew about webpack-blocks which is the same idea but more established. Please use it instead as we will be porting to that and nuking webpack-parts.

webpack-parts

Build your webpack config from composable and opinionated parts.

Installation

$ yarn add --dev webpack-parts

Usage

Combine multiple webpack parts into a webpack config. A part is either an object, which will be merged in to the config, or it is a function that takes the config as it is and is expected to return a new version of the config. The parts are resolved in the order they are provided. There is a small base config that combine starts with that looks like this in production (chunkhash will be omitted if NODE_ENV !== 'production'):

{
  output: {
    filename: '[name].[chunkhash].js',
    chunkFilename: '[name].[chunkhash].js',
    publicPath: '/'
  }
}

Read the documentation to see the various parts that can be used.

Example

// webpack.config.js
const parts = require('webpack-parts')

module.exports = parts.combine(
  {
    entry: "app/index.js",
    output: {
      path: "build"
    }
  },
  parts.load.js(),
  parts.load.css(),
  parts.dev.sourceMaps(),
  parts.optimize.minimize()
)

FAQs

Package last updated on 08 Mar 2018

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc