added option for min loaders for worker

This commit is contained in:
Tobias Koppers 2012-09-26 14:06:59 +02:00
parent 6cc2b7d099
commit 383e1f0eed
3 changed files with 8 additions and 2 deletions

View File

@ -538,6 +538,10 @@ You can also save this options object in a JSON file and use it with the shell c
// workers should not be used in the resolving process
// This may be useful if you want to have your postprocessors in the main process.
workerMinLoaders: 2,
// default: 0
// only process file in seperate process if more or equal loaders applied to the file.
profile: true,
// default: false
// capture timings for the build.

View File

@ -192,7 +192,9 @@ function addModule(depTree, context, modu, options, reason, finalCallback) {
allLoaders.push.apply(allLoaders, preLoaders);
allLoaders.push.apply(allLoaders, loaders);
allLoaders.push.apply(allLoaders, postLoaders);
var seperate = !!(options.workers && options.workers.ready());
var seperate = !!(options.workers &&
options.workers.ready() &&
allLoaders.length >= (options.workerMinLoaders || 0));
try {
for(var i = 0; i < allLoaders.length && seperate; i++) {
var loaderFilename = allLoaders[i];

View File

@ -1,6 +1,6 @@
{
"name": "webpack",
"version": "0.7.0-beta6",
"version": "0.7.0-beta7",
"author": "Tobias Koppers @sokra",
"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.",
"dependencies": {