From 73de27e3d843bad7d2f54bd3a2409df2c819c789 Mon Sep 17 00:00:00 2001 From: Marvin Heilemann Date: Tue, 4 Feb 2020 21:41:59 +0100 Subject: [PATCH] feat: update postcss plugin --- .gitignore | 1 - gatsby-config.js | 20 ++++++++++++++++++-- package.json | 8 +++++--- pnpm-lock.yaml | 4 ++++ postcss.config.js | 15 --------------- 5 files changed, 27 insertions(+), 21 deletions(-) delete mode 100644 postcss.config.js diff --git a/.gitignore b/.gitignore index be9a037..3e6cc3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -data docker/nginx/certs reports .env.* diff --git a/gatsby-config.js b/gatsby-config.js index 6d6256e..d31bec6 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -33,8 +33,24 @@ module.exports = { }, }, `gatsby-plugin-sass`, - `gatsby-plugin-postcss`, - `gatsby-transformer-json`, + { + resolve: `gatsby-plugin-postcss`, + options: { + postCssPlugins: [ + require('autoprefixer'), + require('cssnano')({ + preset: [ + 'default', + { + discardComments: { + removeAll: true, + }, + }, + ], + }), + ], + }, + }`gatsby-transformer-json`, { resolve: `gatsby-plugin-sharp`, options: { diff --git a/package.json b/package.json index b538716..1f1a1d4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "rebuild": "run-s clean build", "clean": "gatsby clean", "serve": "now dev --listen 59235", - "−−−−−−−−−−−−−−−− AUDITS/ANALYTICS −−−−−−−−−−−−−−−−–": "", + "−−−−−−−−−−−−−−−−–−− AUDITS/ANALYTICS −−−−−−−−−−−−−−−−–": "", "audit": "cross-env SITE_URL=\"https://marvin.lcl\" AUDIT=true run-s rebuild audit-server lighthouse audit-open", "audit-server": "make restart", "audit-open": "run-p audit-open:*", @@ -20,7 +20,7 @@ "audit-open:desktop": "node ./scripts/open-report.js lhr.desktop.html", "audit-open:treemap": "node ./scripts/open-report.js treemap.html", "lighthouse": "node ./tests/lighthouse/index.js", - "−−−−−−−−−−−−−−−−−−− LINT/TEST −−−−−−−−−−−−−−−−−−−−–": "", + "−−−−−−−−−−−−−−−−–−---− LINT/TEST −−−−−−−−−−−−−−−−−−−−–": "", "pretest": "npm run rebuild && make restart", "test": "run-s test:*", "test:gatsby": "echo \"Write tests! -> https://gatsby.app/unit-testing\"", @@ -29,7 +29,7 @@ "lint:js": "eslint ./gatsby ./plugins ./scripts ./src ./tests ./utils ./*.js", "lint:scss": "stylelint ./src/styles", "lint:commit": "commitlint --from HEAD~1", - "−−−−−−−−−−−−−−−−− SCRIPTS/TOOLS −−−−−−−−−−−−−−−−–−−": "", + "−-−−−−−−−−−−−−−−−–−----− TOOLS −−−−−−----−−−−−−−−−−–−−": "", "postinstall": "lefthook install", "release": "env-cmd -f ./.env.build release-it --disable-metrics", "pretty": "pretty-quick" @@ -38,7 +38,9 @@ "@mdx-js/mdx": "^1.5.5", "@mdx-js/react": "^1.5.5", "@react-spring/web": "^9.0.0-beta.34", + "autoprefixer": "^9.7.4", "copy-text-to-clipboard": "^2.1.1", + "cssnano": "^4.1.10", "dayjs": "^1.8.19", "dot-prop": "^5.2.0", "gatsby": "^2.19.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b801f55..6b29c2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,7 +2,9 @@ dependencies: '@mdx-js/mdx': 1.5.5 '@mdx-js/react': 1.5.5_react@16.12.0 '@react-spring/web': 9.0.0-beta.34_react-dom@16.12.0+react@16.12.0 + autoprefixer: 9.7.4 copy-text-to-clipboard: 2.1.1 + cssnano: 4.1.10 dayjs: 1.8.20 dot-prop: 5.2.0 gatsby: 2.19.12_d7bda3fccfec5130535f072cbb5f70e7 @@ -18170,9 +18172,11 @@ specifiers: '@mdx-js/react': ^1.5.5 '@react-spring/web': ^9.0.0-beta.34 '@release-it/conventional-changelog': ^1.1.0 + autoprefixer: ^9.7.4 chrome-launcher: ^0.12.0 copy-text-to-clipboard: ^2.1.1 cross-env: ^7.0.0 + cssnano: ^4.1.10 dayjs: ^1.8.19 dot-prop: ^5.2.0 env-cmd: ^10.0.1 diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index ed189ff..0000000 --- a/postcss.config.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - plugins: [ - require('autoprefixer'), - require('cssnano')({ - preset: [ - 'default', - { - discardComments: { - removeAll: true, - }, - }, - ], - }), - ], -}