Skip to content
This repository was archived by the owner on Feb 7, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
{
"presets": [
["env", {
"targets": {"node": 4}
}
]]
"presets": [
[
"env",
{
"targets": { "node": 6 }
}
]
],
"plugins": [
"syntax-trailing-function-commas",
"transform-es2015-destructuring",
"transform-es2015-parameters",
"transform-async-to-generator",
"transform-strict-mode",
"transform-object-rest-spread",
"transform-es2015-modules-commonjs",
"transform-async-to-generator"
],
"retainLines": true
}
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ jobs:
docker:
# specify the version you desire here
- image: circleci/node:6
- image: circleci/node:8
- image: circleci/node:latest

working_directory: ~/repo
Expand All @@ -13,6 +14,6 @@ jobs:

- run: npm install

- run: npm run test-only
- run: npm run test-only


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
coverage/
dist/
17 changes: 17 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Do not pack irrelevant dirs
node_modules/
coverage/
__mocks__/
__tests__/
build/

# Do not pack configs
jest.config.js
.circleci/
.github/
.babelrc
.editorconfig
.gitignore
.prettierrc
.travis.yml
yarn.lock
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"overrides": [
{
"files": "**/{build,bin}/**",
"options": {
"trailingComma": "es5"
}
}
]
}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: node_js
node_js:
- "node"
- "6"
- "8"

install:
- npm install
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![npm version](https://badge.fury.io/js/parallel-webpack.svg)](https://badge.fury.io/js/parallel-webpack)
[![Build Status](https://travis-ci.org/trivago/parallel-webpack.svg?branch=master)](https://travis-ci.org/trivago/parallel-webpack) [![CircleCI](https://circleci.com/gh/trivago/parallel-webpack.svg?style=svg)](https://circleci.com/gh/trivago/parallel-webpack) [![Coverage Status](https://coveralls.io/repos/github/trivago/parallel-webpack/badge.svg?branch=coverage)](https://coveralls.io/github/trivago/parallel-webpack?branch=coverage)
[![Build Status](https://travis-ci.org/trivago/parallel-webpack.svg?branch=master)](https://travis-ci.org/trivago/parallel-webpack)
[![CircleCI](https://circleci.com/gh/trivago/parallel-webpack.svg?style=svg)](https://circleci.com/gh/trivago/parallel-webpack)
[![Coverage Status](https://coveralls.io/repos/github/trivago/parallel-webpack/badge.svg?branch=coverage)](https://coveralls.io/github/trivago/parallel-webpack?branch=coverage)
# parallel-webpack - Building multi-configs in parallel

`parallel-webpack` allows you to run multiple webpack builds in parallel,
Expand All @@ -8,10 +10,18 @@ up your build. For us at [trivago](http://www.trivago.com) it has reduced
the build from 16 minutes to just 2 minutes - for 32 variants. That performance
improvement naturally comes at the expense of utilizing all available CPU cores.

# IMPORTANT: Starting from 3.x watch mode will be dropped
Starting from 3.x series we will drop support for watch mode. If you need it
keep using ^2.2.0.

## Installation

```sh
npm install parallel-webpack --save-dev

# or

yarn add --dev parallel-webpack
```

You can choose whether to install `parallel-webpack` globally or locally.
Expand Down Expand Up @@ -127,17 +137,6 @@ The above configuration will create 16 variations of the build for you, which
[WEBPACK] Started building MyLib.var.min.debug.js
```

## Running the watcher

One of the features that made webpack so popular is certainly its watcher which
continously rebuilds your application.

When using `parallel-webpack`, you can easily use the same feature as well by
specifying the `--watch` option on the command line:

```
parallel-webpack --watch
```

## Specifying retry limits

Expand Down Expand Up @@ -212,7 +211,8 @@ are no differences between various ways of invoking the `webpack.config.js`.
## Node.js API

Just like webpack, you can also use `parallel-webpack` as an API from node.js
(You can specify any other option used in [worker-farm](https://www.npmjs.com/package/worker-farm)):
(For 2.x : you can specify any other option used in [worker-farm](https://www.npmjs.com/package/worker-farm)):
(For 3.x : you can specify any other option used in [jest-worker](https://www.npmjs.com/package/jest-worker)):

```javascript
var run = require('parallel-webpack').run,
Expand All @@ -222,7 +222,8 @@ run(configPath, {
watch: false,
maxRetries: 1,
stats: true, // defaults to false
maxConcurrentWorkers: 2 // use 2 workers
maxConcurrentWorkers: 2, // use 2 workers if you are on 2.x version
maxWorkers: 2 // use 2 workers if you are in 3.x version
});
```

Expand Down
13 changes: 0 additions & 13 deletions __mocks__/bluebird.js

This file was deleted.

4 changes: 0 additions & 4 deletions __mocks__/worker-farm.js

This file was deleted.

50 changes: 0 additions & 50 deletions __tests__/__snapshots__/index.spec.js.snap

This file was deleted.

163 changes: 0 additions & 163 deletions __tests__/index.spec.js

This file was deleted.

Loading