Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit 9af211f

Browse files
committed
Optimize and compress stylesheet with CSSNano
1 parent 68ff805 commit 9af211f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"babel-eslint": "10.0.2",
8383
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
8484
"babel-polyfill": "^6.26.0",
85+
"cssnano": "^4.1.10",
8586
"eslint": "^6.2.0",
8687
"eslint-config-airbnb": "^18.0.1",
8788
"eslint-config-prettier": "^6.1.0",

rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import filesize from 'rollup-plugin-filesize';
55
import resolve from 'rollup-plugin-node-resolve';
66
import postcss from 'rollup-plugin-postcss';
77
import autoprefixer from 'autoprefixer';
8+
import cssnano from 'cssnano';
89
import pkg from './package.json';
910

1011
const root = process.platform === 'win32' ? path.resolve('/') : '/';
@@ -31,7 +32,7 @@ export default {
3132
external: id =>
3233
!id.startsWith('.') && !id.startsWith(root) && !id.includes('style-inject'),
3334
plugins: [
34-
postcss({ plugins: [autoprefixer] }),
35+
postcss({ plugins: [autoprefixer, cssnano] }),
3536
babel({
3637
exclude: 'node_modules/**',
3738
runtimeHelpers: true

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ cssnano-util-same-parent@^4.0.0:
21152115
resolved "https://registry.yarnpkg.com/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz#574082fb2859d2db433855835d9a8456ea18bbf3"
21162116
integrity sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==
21172117

2118-
cssnano@^4.1.8:
2118+
cssnano@^4.1.10, cssnano@^4.1.8:
21192119
version "4.1.10"
21202120
resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.10.tgz#0ac41f0b13d13d465487e111b778d42da631b8b2"
21212121
integrity sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==

0 commit comments

Comments
 (0)