thread-loader icon indicating copy to clipboard operation
thread-loader copied to clipboard

Unclear on Documentation

Open rodoabad opened this issue 3 years ago • 0 comments

The documentation says the following.

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        include: path.resolve('src'),
        use: [
          'thread-loader',
          // your expensive loader (e.g babel-loader)
        ],
      },
    ],
  },
};

But what if you have multiple loaders?

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        include: path.resolve('src'),
        use: [
          'thread-loader',
          'foo-loader',
          'bar-loader',
        ],
      },
    ],
  },
};

Do I need one on each loader?

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        include: path.resolve('src'),
        use: [
          'thread-loader',
          'foo-loader',
          'thread-loader',
          'bar-loader',
          'thread-loader',
          'buz-loader',
        ],
      },
    ],
  },
};

rodoabad avatar Jan 21 '22 05:01 rodoabad