andywer / webpack-blocks

📦 Configure webpack using functional feature blocks.
MIT License
2.97k stars 94 forks source link

Improve DX #171

Open andywer opened 7 years ago

andywer commented 7 years ago

Improve the experience of using webpack-blocks as shared by @zcei: see comment

zcei commented 7 years ago

Hej, I thought it might be cool to provide the actual configuration output of each block in its README, like this for babel:

Result

{
  module: {
    rules: [{
      test: context.match.test, // /\.(js|jsx)$/
      exclude: context.match.exclude, // /node_modules/
      use: [{
        loader: 'babel-loader',
        options: {
          cacheDirectory: options.cacheDirectory // true
        }
      }]
    }]
  }
}

I think this would make it easier to grasp when coming from a "pure" webpack background. What do you think?

(I would volunteer running each block once and adjusting the output to the style above & filing a PR)

andywer commented 7 years ago

Good idea! I am just not sure whether to provide the test: context.match.test stuff or the actual output for some example input.