Skip to content

Commit 383e1f0

Browse files
committed
added option for min loaders for worker
1 parent 6cc2b7d commit 383e1f0

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,10 @@ You can also save this options object in a JSON file and use it with the shell c
538538
// workers should not be used in the resolving process
539539
// This may be useful if you want to have your postprocessors in the main process.
540540

541+
workerMinLoaders: 2,
542+
// default: 0
543+
// only process file in seperate process if more or equal loaders applied to the file.
544+
541545
profile: true,
542546
// default: false
543547
// capture timings for the build.

‎lib/buildDeps.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ function addModule(depTree, context, modu, options, reason, finalCallback) {
192192
allLoaders.push.apply(allLoaders, preLoaders);
193193
allLoaders.push.apply(allLoaders, loaders);
194194
allLoaders.push.apply(allLoaders, postLoaders);
195-
var seperate = !!(options.workers && options.workers.ready());
195+
var seperate = !!(options.workers &&
196+
options.workers.ready() &&
197+
allLoaders.length >= (options.workerMinLoaders || 0));
196198
try {
197199
for(var i = 0; i < allLoaders.length && seperate; i++) {
198200
var loaderFilename = allLoaders[i];

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "0.7.0-beta6",
3+
"version": "0.7.0-beta7",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loading of js, json, jade, coffee, css, ... out of the box and more with custom loaders.",
66
"dependencies": {

0 commit comments

Comments
 (0)