Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hard-source-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hard-source-webpack-plugin

Hard cache the source of modules in webpack.

  • 0.13.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
229K
decreased by-6.18%
Maintainers
1
Weekly downloads
 
Created

What is hard-source-webpack-plugin?

The hard-source-webpack-plugin is a plugin for webpack that provides an intermediate caching step for modules. This can significantly speed up the build process by caching the results of module compilation and reusing them in subsequent builds.

What are hard-source-webpack-plugin's main functionalities?

Caching

The primary feature of hard-source-webpack-plugin is its ability to cache the results of module compilation. This can drastically reduce build times by reusing previously compiled modules.

const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');

module.exports = {
  // other webpack configuration
  plugins: [
    new HardSourceWebpackPlugin()
  ]
};

Cache Invalidation

The plugin allows for sophisticated cache invalidation strategies, ensuring that the cache remains valid and up-to-date with the current state of the codebase.

const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');

module.exports = {
  // other webpack configuration
  plugins: [
    new HardSourceWebpackPlugin({
      cacheDirectory: 'path/to/cache',
      recordsPath: 'path/to/cache/records.json',
      configHash: function(webpackConfig) {
        return require('node-object-hash')({ sort: false }).hash(webpackConfig);
      },
    })
  ]
};

Parallel Caching

The plugin supports parallel caching, which can further speed up the build process by allowing multiple caches to be used simultaneously.

const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');

module.exports = {
  // other webpack configuration
  plugins: [
    new HardSourceWebpackPlugin({
      environmentHash: {
        root: process.cwd(),
        directories: [],
        files: ['package-lock.json', 'yarn.lock'],
      },
    })
  ]
};

Other packages similar to hard-source-webpack-plugin

Keywords

FAQs

Package last updated on 10 Dec 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