All Projects → diegohaz → webpack-blocks-happypack

diegohaz / webpack-blocks-happypack

Licence: MIT License
A webpack block that adds happypack support to your webpack config

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webpack-blocks-happypack

Build-vue-hackernews-2.0-from-scratch
A tutorial for beginners to build a complex project with Vue.js 2.0 step by step
Stars: ✭ 85 (+608.33%)
Mutual labels:  webpack2
react-flux-gulp-starter
A universal boilerplate for building React/Flux apps using Gulp and ES6.
Stars: ✭ 46 (+283.33%)
Mutual labels:  webpack2
ignore-emit-webpack-plugin
Prevents ignored files from being emitted during a Webpack build
Stars: ✭ 17 (+41.67%)
Mutual labels:  webpack2
better-keyboard
A js keyboard component for mobile.
Stars: ✭ 55 (+358.33%)
Mutual labels:  webpack2
webpack2-tutorial
A webpack2 tutorial for beginners
Stars: ✭ 20 (+66.67%)
Mutual labels:  webpack2
react-redux-webpack-lazy-loading
The follow up example of react-webpack-lazy-loading now using Redux
Stars: ✭ 16 (+33.33%)
Mutual labels:  webpack2
react-js-boilerplate
A React + Redux + HOT + Webpack + Material-UI + Sass boilerplate
Stars: ✭ 14 (+16.67%)
Mutual labels:  webpack2
NEUQ-OJ
基于 React 开发的 Online Judge 系统
Stars: ✭ 19 (+58.33%)
Mutual labels:  webpack2
xRoute
一个小型的前端路由库✈️
Stars: ✭ 36 (+200%)
Mutual labels:  webpack2
exif-loader
Extract EXIF- & IPTC-data from your JPGs during build-time.
Stars: ✭ 14 (+16.67%)
Mutual labels:  webpack2
cloudMusic
(移动端)Vue2.0+Nodejs网易云音乐,网易云音乐api强力驱动,高音质破解(持续更新中)
Stars: ✭ 14 (+16.67%)
Mutual labels:  webpack2
jschr.io
The static website generator service behind jschr.io.
Stars: ✭ 70 (+483.33%)
Mutual labels:  webpack2
quantum-blox
Quantum blox - modular UI boilerplate in react
Stars: ✭ 12 (+0%)
Mutual labels:  webpack2
angular2-instagram
🔥Instagram like photo filter playground built with Angular2 (Web | Desktop)
Stars: ✭ 91 (+658.33%)
Mutual labels:  webpack2
neutrino-preset-typescript
A Neutrino preset that supports building Typescript web applications
Stars: ✭ 16 (+33.33%)
Mutual labels:  webpack2
react-theme
Production ready Wordpress theme built with React, Redux, Redux-Thunk, Intl, React Router v4, etc... and packaged by Webpack 2. Enjoy!
Stars: ✭ 14 (+16.67%)
Mutual labels:  webpack2
webpack-aws-lambda
AWS Lambda that runs webpack and output the bundle.js file
Stars: ✭ 12 (+0%)
Mutual labels:  webpack2
angular-webpack-skeleton
This project is deprecated. Please refer to https://github.com/Ks89/angular-cli-skeleton
Stars: ✭ 16 (+33.33%)
Mutual labels:  webpack2
fanpianAdmin
This is the admin for fanpian project written by react.
Stars: ✭ 27 (+125%)
Mutual labels:  webpack2
modul-typescript-template
Template to start a new project with Modul / Vuejs / Typescript
Stars: ✭ 13 (+8.33%)
Mutual labels:  webpack2

webpack-blocks-happypack

Generated with nod NPM version Build Status Coverage Status

A webpack block that adds happypack support to your webpack config.

This package is based on the PR by @fenos on the official webpack-blocks repository.

Install

$ npm install --save-dev webpack-blocks-happypack

Usage

Basic

const { createConfig, babel, css, extractText } = require('webpack-blocks')
const happypack = require('webpack-blocks-happypack')

const config = createConfig([
  css.modules(),
  happypack([
    // these will be happypack'd
    extractText(),
    babel(),
  ]),
])

Configuration

const config = createConfig([
  happypack([
    babel(),
  ], {
    // default options
    loaders: ['babel-loader', 'css-loader'], // allowed loaders
    cache: !process.env.DISABLE_HAPPY_CACHE,
    cacheContext: {
      env: process.env.NODE_ENV,
      refresh: process.env.REFRESH_HAPPY_CACHE ? Math.random() : 0,
      // ... add or override happypack cacheContext options
    },
    // ... add or override happypack options
  }),
])

Environment variables

$ DISABLE_HAPPY=true webpack # turns happypack off and run webpack
$ DISABLE_HAPPY_CACHE=true webpack # turns happypack cache off and run webpack
$ REFRESH_HAPPY_CACHE=true webpack # refreshes happypack cache and run webpack

How it does

This webpack block adds HappyPack plugins with proper IDs and replaces loaders by happypack/loader?id=${id}.

API

Table of Contents

happypack

Parameters

  • blocks Array<WebpackBlock>
  • $1 any (optional, default {})
    • $1.loaders (optional, default ['babel-loader','css-loader'])
    • $1.happypackOptions ...any

Returns Array<Block>

Loader

Type: string

Rule

Type: {test: RegExp, loader: (Loader | Array<Loader>)?, loaders: (Loader | Array<Loader>)?, use: (Loader | Array<Loader>)?, options: Object?}

Properties

Block

Type: {plugins: Array<any>?, module: {loaders: Array<Rule>?, rules: Array<Rule>?}}

Properties

BlockOptions

Type: {loaders: Array<string>?, refresh: boolean?, cache: any?, cacheContext: {}?}

Properties

WebpackBlock

Type: function (context: any, utils: any): function (prevCongig: any): Block

Other useful webpack blocks

License

MIT © Diego Haz

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].