andywer / andywer/webpack-blocks

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

Offen
#60 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
discussion new block
Vorherrschende Sprache
JavaScript
Sterne
3k
Forks
91
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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:

* Babel with `babel-preset-env` (target `last 2 versions` for instance)
* PostCSS with autoprefixer (similar target as set for `babel-preset-env`)
* Set `process.env.NODE_ENV` (in output code, using `defineConstants`)
* Source maps in development mode
* Minification and optimization in production build mode
* Set `resolve.extensions` to webpack defaults plus the popular `''` (so it's nice to use with `createConfig.vanilla()` as well; only needed for webpack 1.x)

## Not sure if those should be included

* HTML loader
* HtmlWebpackPlugin

## Problems left to solve

* ~~Cannot set PostCSS plugins from within webpack config anymore when using webpack 2~~ (fixed by #74 🎉)

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.