andywer / webpack-blocks

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

Create preset for common basics: Babel + Autoprefixer + best practice config #60

Open andywer opened 7 years ago

andywer commented 7 years ago

Since probably 90%+ of the users will want to have Babel and the autoprefixer it would be nice to ship a preset (using group()) that sets some blocks configured in a best-practice manner:

Not sure if those should be included

Problems left to solve

stevenjlho commented 7 years ago

Have method to expose preset now?

sapegin commented 7 years ago

'' is not needed for webpack 2.

andywer commented 7 years ago

@stevenjlho Not sure what you mean. Writing presets is already possible, just did not write any yet.

@sapegin True! Edited it :)

aaronjensen commented 7 years ago

FWIW, I think this is too much to include by default. Specifically postcss/babel-preset-env. The other stuff seems fine as a base, I'd have that be a preset rather than a required base.

andywer commented 7 years ago

The idea of that particular preset was to provide some sane defaults to quickly get a fresh project up and running, that's why babel and autoprefixer are listed here. I had something like a create-react-app preset in mind.

Since we are about to remove all implicitly set defaults from createConfig() (#111), it might be wise, though, to create another preset that really just ships the bare minimum of best practice configuration 👍

sapegin commented 7 years ago

I think this kind of presets are out of the scope of webpack-blocks because it makes setup still more complicated then CRA but at the same time you can’t easily modify and customize this preset (the main issue of CRA and the main selling point of webpack-blocks in my opinion) and can’t easily see what’s inside. I think we rather need a cookbook like chapter in the docs that would explain how to use webpack-blocks for React, Vue, Angular, whatever. So you could easily copy configuration and modify it for your project.

andywer commented 7 years ago

Fair enough.