Minify css using postcss (#732)

* Minify css using postcss

* Optimize data uris as build time
This commit is contained in:
Jordan Eldredge 2019-03-02 19:52:19 -08:00 committed by GitHub
parent b563eebf96
commit 2bcd69762d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 1882 additions and 46 deletions

View file

@ -11,7 +11,20 @@ module.exports = {
rules: [
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
use: [
"style-loader",
{ loader: "css-loader", options: { importLoaders: 1 } },
// We really only need this in prod. We could find a way to disable it in dev.
{
loader: "postcss-loader",
options: {
plugins: [
require("cssnano"),
require("../scripts/postcss-optimize-data-uri-pngs")
]
}
}
]
},
{
test: /\.(js|ts|tsx)$/,