{"id":15020109,"url":"https://github.com/diegohaz/webpack-blocks-happypack","last_synced_at":"2025-06-10T11:35:35.464Z","repository":{"id":66339822,"uuid":"87030026","full_name":"diegohaz/webpack-blocks-happypack","owner":"diegohaz","description":"A webpack block that adds happypack support to your webpack config","archived":false,"fork":false,"pushed_at":"2018-02-07T17:02:07.000Z","size":142,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T15:58:47.190Z","etag":null,"topics":["happypack","webpack","webpack-blocks","webpack2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diegohaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-03T01:56:54.000Z","updated_at":"2018-07-23T05:12:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"22dfde5d-3669-481f-bbfe-2d3cb4eef0b6","html_url":"https://github.com/diegohaz/webpack-blocks-happypack","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.3939393939393939,"last_synced_commit":"ec989ec2c8efa873ed6b9f5887a70078235c4942"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fwebpack-blocks-happypack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fwebpack-blocks-happypack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fwebpack-blocks-happypack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fwebpack-blocks-happypack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diegohaz","download_url":"https://codeload.github.com/diegohaz/webpack-blocks-happypack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fwebpack-blocks-happypack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259067826,"owners_count":22800401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["happypack","webpack","webpack-blocks","webpack2"],"created_at":"2024-09-24T19:54:36.261Z","updated_at":"2025-06-10T11:35:35.438Z","avatar_url":"https://github.com/diegohaz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-blocks-happypack\n\n[![Generated with nod](https://img.shields.io/badge/generator-nod-2196F3.svg?style=flat-square)](https://github.com/diegohaz/nod)\n[![NPM version](https://img.shields.io/npm/v/webpack-blocks-happypack.svg?style=flat-square)](https://npmjs.org/package/webpack-blocks-happypack)\n[![Build Status](https://img.shields.io/travis/diegohaz/webpack-blocks-happypack/master.svg?style=flat-square)](https://travis-ci.org/diegohaz/webpack-blocks-happypack) [![Coverage Status](https://img.shields.io/codecov/c/github/diegohaz/webpack-blocks-happypack/master.svg?style=flat-square)](https://codecov.io/gh/diegohaz/webpack-blocks-happypack/branch/master)\n\nA webpack block that adds [happypack](https://github.com/amireh/happypack) support to your webpack config.\n\nThis package is based on the [PR](https://github.com/andywer/webpack-blocks/pull/126) by [**@fenos**](https://github.com/fenos) on the official [webpack-blocks](https://github.com/andywer/webpack-blocks) repository.\n\n## Install\n\n    $ npm install --save-dev webpack-blocks-happypack\n\n## Usage\n\n### Basic\n\n```js\nconst { createConfig, babel, css, extractText } = require('webpack-blocks')\nconst happypack = require('webpack-blocks-happypack')\n\nconst config = createConfig([\n  css.modules(),\n  happypack([\n    // these will be happypack'd\n    extractText(),\n    babel(),\n  ]),\n])\n```\n\n### Configuration\n\n```js\nconst config = createConfig([\n  happypack([\n    babel(),\n  ], {\n    // default options\n    loaders: ['babel-loader', 'css-loader'], // allowed loaders\n    cache: !process.env.DISABLE_HAPPY_CACHE,\n    cacheContext: {\n      env: process.env.NODE_ENV,\n      refresh: process.env.REFRESH_HAPPY_CACHE ? Math.random() : 0,\n      // ... add or override happypack cacheContext options\n    },\n    // ... add or override happypack options\n  }),\n])\n```\n\n### Environment variables\n\n```sh\n$ DISABLE_HAPPY=true webpack # turns happypack off and run webpack\n$ DISABLE_HAPPY_CACHE=true webpack # turns happypack cache off and run webpack\n$ REFRESH_HAPPY_CACHE=true webpack # refreshes happypack cache and run webpack\n```\n\n## How it does\n\nThis webpack block adds `HappyPack` plugins with proper IDs and replaces loaders by `happypack/loader?id=${id}`.\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n-   [happypack](#happypack)\n-   [Loader](#loader)\n-   [Rule](#rule)\n-   [Block](#block)\n-   [BlockOptions](#blockoptions)\n-   [WebpackBlock](#webpackblock)\n\n### happypack\n\n**Parameters**\n\n-   `blocks` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[WebpackBlock](#webpackblock)\u003e** \n-   `$1` **any**  (optional, default `{}`)\n    -   `$1.loaders`   (optional, default `['babel-loader','css-loader']`)\n    -   `$1.happypackOptions` **...any** \n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Block](#block)\u003e** \n\n### Loader\n\nType: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n### Rule\n\nType: {test: [RegExp](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp), loader: ([Loader](#loader) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Loader](#loader)\u003e)?, loaders: ([Loader](#loader) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Loader](#loader)\u003e)?, use: ([Loader](#loader) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Loader](#loader)\u003e)?, options: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?}\n\n**Properties**\n\n-   `test` **[RegExp](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp)** \n-   `loader` **([Loader](#loader) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Loader](#loader)\u003e)?** \n-   `loaders` **([Loader](#loader) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Loader](#loader)\u003e)?** \n-   `use` **([Loader](#loader) \\| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Loader](#loader)\u003e)?** \n-   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** \n\n### Block\n\nType: {plugins: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;any\u003e?, module: {loaders: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Rule](#rule)\u003e?, rules: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Rule](#rule)\u003e?}}\n\n**Properties**\n\n-   `plugins` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;any\u003e?** \n-   `module` **{loaders: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Rule](#rule)\u003e?, rules: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Rule](#rule)\u003e?}** \n-   `module.loaders` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Rule](#rule)\u003e?** \n-   `module.rules` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Rule](#rule)\u003e?** \n\n### BlockOptions\n\nType: {loaders: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e?, refresh: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, cache: any?, cacheContext: {}?}\n\n**Properties**\n\n-   `loaders` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e?** \n-   `refresh` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** \n-   `cache` **any?** \n-   `cacheContext` **{}?** \n\n### WebpackBlock\n\nType: function (context: any, utils: any): function (prevCongig: any): [Block](#block)\n\n## Other useful webpack blocks\n\n-   [`webpack-blocks-split-vendor`](https://github.com/diegohaz/webpack-blocks-split-vendor)\n-   [`webpack-blocks-server-source-map`](https://github.com/diegohaz/webpack-blocks-server-source-map)\n\n## License\n\nMIT © [Diego Haz](https://github.com/diegohaz)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegohaz%2Fwebpack-blocks-happypack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegohaz%2Fwebpack-blocks-happypack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegohaz%2Fwebpack-blocks-happypack/lists"}