webpack-blocks icon indicating copy to clipboard operation
webpack-blocks copied to clipboard

Improve DX

Open andywer opened this issue 7 years ago • 2 comments

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

  • [x] core: More useful output for createConfig() block assertion
  • [ ] dev-server: Document that it adds the HotModuleReplacementPlugin; maybe don't add it at all if --hot is found in the arguments (see webpack-contrib/style-loader#18)
  • [ ] extract-text: Investigate if re-using a plugin instance for multiple matches with the same file type test makes sense

andywer avatar Jul 02 '17 20:07 andywer

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)

zcei avatar Jul 03 '17 19:07 zcei

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

andywer avatar Jul 03 '17 20:07 andywer