ускоряет сборку в dev режиме

This commit is contained in:
Maxim Slipenko 2022-05-13 21:39:47 +03:00
parent b79a628940
commit 93b06ae1e8
Signed by: Maks1mS
GPG Key ID: 7461AF39A8705FB8
3 changed files with 16 additions and 2 deletions

9
package-lock.json generated
View File

@ -1290,6 +1290,15 @@
"vary": "^1" "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": { "cross-spawn": {
"version": "7.0.3", "version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",

View File

@ -3,7 +3,7 @@
"scripts": { "scripts": {
"prestart": "", "prestart": "",
"start": "npx @11t/eleventy --serve", "start": "npx @11t/eleventy --serve",
"build": "npx @11t/eleventy" "build": "cross-env NODE_ENV=production npx @11t/eleventy"
}, },
"devDependencies": { "devDependencies": {
"@11ty/eleventy": "^1.0.1", "@11ty/eleventy": "^1.0.1",
@ -11,6 +11,7 @@
"@cagov/11ty-build-system": "^0.3.0", "@cagov/11ty-build-system": "^0.3.0",
"@rollup/plugin-node-resolve": "^13.3.0", "@rollup/plugin-node-resolve": "^13.3.0",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.7",
"cross-env": "^7.0.3",
"cssnano": "^5.1.7", "cssnano": "^5.1.7",
"eleventy-favicon": "^1.1.3", "eleventy-favicon": "^1.1.3",
"eleventy-plugin-svg-contents": "^0.7.0", "eleventy-plugin-svg-contents": "^0.7.0",

View File

@ -1,9 +1,13 @@
const cssnano = require('cssnano')({
preset: 'default'
})
module.exports = { module.exports = {
from: 'src/css/index.css', from: 'src/css/index.css',
to: 'dist/css/index.css', to: 'dist/css/index.css',
plugins: [ plugins: [
require('tailwindcss'), require('tailwindcss'),
require('autoprefixer'), require('autoprefixer'),
require('cssnano') ...(process.env.NODE_ENV === 'production' ? [cssnano] : [])
] ]
} }