From 93b06ae1e865d31c36c74fb7c9f6629c12f8176a Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Fri, 13 May 2022 21:39:47 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D1=81=D0=BA=D0=BE=D1=80=D1=8F=D0=B5?= =?UTF-8?q?=D1=82=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D1=83=20=D0=B2=20dev=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B6=D0=B8=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 9 +++++++++ package.json | 3 ++- postcss.config.js | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1048bc..8e38d7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1290,6 +1290,15 @@ "vary": "^1" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index b6fef15..381cc1e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "scripts": { "prestart": "", "start": "npx @11t/eleventy --serve", - "build": "npx @11t/eleventy" + "build": "cross-env NODE_ENV=production npx @11t/eleventy" }, "devDependencies": { "@11ty/eleventy": "^1.0.1", @@ -11,6 +11,7 @@ "@cagov/11ty-build-system": "^0.3.0", "@rollup/plugin-node-resolve": "^13.3.0", "autoprefixer": "^10.4.7", + "cross-env": "^7.0.3", "cssnano": "^5.1.7", "eleventy-favicon": "^1.1.3", "eleventy-plugin-svg-contents": "^0.7.0", diff --git a/postcss.config.js b/postcss.config.js index 9de3bdd..dc286cf 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,9 +1,13 @@ +const cssnano = require('cssnano')({ + preset: 'default' +}) + module.exports = { from: 'src/css/index.css', to: 'dist/css/index.css', plugins: [ require('tailwindcss'), require('autoprefixer'), - require('cssnano') + ...(process.env.NODE_ENV === 'production' ? [cssnano] : []) ] }