Skip to content

Commit

Permalink
fix: listen end events (#42)
Browse files Browse the repository at this point in the history
In the event that the read stream terminates before all of the data
has been read, the pipe will send an 'end' event. We should listen for
this event and hit the callback with it, instead of hanging forever.
  • Loading branch information
mistic authored and evilebottnawi committed Dec 18, 2018
1 parent fcbd813 commit 0f87683
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 855 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Expand Up @@ -19,14 +19,18 @@ jobs:
env: WEBPACK_VERSION=latest JOB_PART=lint
script: npm run travis:$JOB_PART
- <<: *test-latest
node_js: 8
node_js: 10
env: WEBPACK_VERSION=latest JOB_PART=coverage
script: npm run travis:$JOB_PART
after_success: 'bash <(curl -s https://codecov.io/bash)'
- <<: *test-latest
node_js: 10
env: WEBPACK_VERSION=latest JOB_PART=test
script: npm run travis:$JOB_PART
- stage: Webpack canary
before_script: npm i --no-save git://github.com/webpack/webpack.git#master
script: npm run travis:$JOB_PART
node_js: 8
node_js: 6
env: WEBPACK_VERSION=canary JOB_PART=test
before_install:
- 'if [[ `npm -v` != 5* ]]; then npm i -g npm@^5.0.0; fi'
Expand Down
6 changes: 3 additions & 3 deletions example/webpack.config.js
@@ -1,6 +1,6 @@
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // eslint-disable-line import/no-extraneous-dependencies
const threadLoader = require('thread-loader'); // eslint-disable-line import/no-extraneous-dependencies
const threadLoader = require('../src'); // eslint-disable-line import/no-extraneous-dependencies

module.exports = (env) => {
const workerPool = {
Expand Down Expand Up @@ -30,7 +30,7 @@ module.exports = (env) => {
test: /\.js$/,
use: [
env.threads !== 0 && {
loader: 'thread-loader',
loader: path.resolve(__dirname, '../src/index.js'),
options: workerPool,
},
'babel-loader',
Expand All @@ -41,7 +41,7 @@ module.exports = (env) => {
use: [
MiniCssExtractPlugin.loader,
env.threads !== 0 && {
loader: 'thread-loader',
loader: path.resolve(__dirname, '../src/index.js'),
options: workerPoolSass,
},
'css-loader',
Expand Down

0 comments on commit 0f87683

Please sign in to comment.