Unverified Commit 20200ad8 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Provide Next.js postcss version to cssnano-simple (#26952)

Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent b6c590bc
...@@ -48,7 +48,7 @@ export class CssMinimizerPlugin { ...@@ -48,7 +48,7 @@ export class CssMinimizerPlugin {
input = asset.source() input = asset.source()
} }
return postcss([cssnanoSimple]) return postcss([cssnanoSimple({}, postcss)])
.process(input, postcssOptions) .process(input, postcssOptions)
.then((res) => { .then((res) => {
if (res.map) { if (res.map) {
......
...@@ -18,11 +18,14 @@ import { ...@@ -18,11 +18,14 @@ import {
function minifyCss(css: string): Promise<string> { function minifyCss(css: string): Promise<string> {
return postcss([ return postcss([
minifier({ minifier(
excludeAll: true, {
discardComments: true, excludeAll: true,
normalizeWhitespace: { exclude: false }, discardComments: true,
}), normalizeWhitespace: { exclude: false },
},
postcss
),
]) ])
.process(css, { from: undefined }) .process(css, { from: undefined })
.then((res) => res.css) .then((res) => res.css)
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
"chokidar": "3.5.1", "chokidar": "3.5.1",
"constants-browserify": "1.0.0", "constants-browserify": "1.0.0",
"crypto-browserify": "3.12.0", "crypto-browserify": "3.12.0",
"cssnano-simple": "2.0.0", "cssnano-simple": "2.1.0",
"domain-browser": "4.19.0", "domain-browser": "4.19.0",
"encoding": "0.1.13", "encoding": "0.1.13",
"etag": "1.8.1", "etag": "1.8.1",
......
...@@ -3,8 +3,7 @@ declare module 'next/dist/compiled/babel/plugin-transform-modules-commonjs' ...@@ -3,8 +3,7 @@ declare module 'next/dist/compiled/babel/plugin-transform-modules-commonjs'
declare module 'next/dist/compiled/babel/plugin-syntax-jsx' declare module 'next/dist/compiled/babel/plugin-syntax-jsx'
declare module 'browserslist' declare module 'browserslist'
declare module 'cssnano-simple' { declare module 'cssnano-simple' {
import { OldPlugin } from 'postcss' const cssnanoSimple: any
const cssnanoSimple: OldPlugin<{}>
export = cssnanoSimple export = cssnanoSimple
} }
declare module 'styled-jsx/server' declare module 'styled-jsx/server'
......
...@@ -7284,10 +7284,10 @@ cssnano-simple@1.2.1: ...@@ -7284,10 +7284,10 @@ cssnano-simple@1.2.1:
cssnano-preset-simple "1.2.1" cssnano-preset-simple "1.2.1"
postcss "^7.0.32" postcss "^7.0.32"
cssnano-simple@2.0.0: cssnano-simple@2.1.0:
version "2.0.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/cssnano-simple/-/cssnano-simple-2.0.0.tgz#930d9dcd8ba105c5a62ce719cb00854da58b5c05" resolved "https://registry.yarnpkg.com/cssnano-simple/-/cssnano-simple-2.1.0.tgz#747a110ceff616ba2e883e2cb64666f0a87acd8b"
integrity sha512-0G3TXaFxlh/szPEG/o3VcmCwl0N3E60XNb9YZZijew5eIs6fLjJuOPxQd9yEBaX2p/YfJtt49i4vYi38iH6/6w== integrity sha512-iFisFT39FT1YCw7ydvvRH4Yq0ftVBQGfGXuKv8TJ9WOzmPXaw7MZbxBzFQoeJUVCp+fGf6tvwaQqSigw4tvn7w==
dependencies: dependencies:
cssnano-preset-simple "^2.0.0" cssnano-preset-simple "^2.0.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment