purge and nanoify

This commit is contained in:
Jfriedli 2021-03-21 15:56:23 +01:00
parent 8bb860a865
commit 524e055e8c
4 changed files with 7504 additions and 2 deletions

7497
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
"version": "0.5.0", "version": "0.5.0",
"description": "A web version of mat2! ", "description": "A web version of mat2! ",
"scripts": { "scripts": {
"build:css": "postcss static/src/main.css -o static/dist/main.css" "build:css": "postcss static/src/main.css -o static/dist/main.css --env=production"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -22,6 +22,7 @@
"@fullhuman/postcss-purgecss": "^4.0.2", "@fullhuman/postcss-purgecss": "^4.0.2",
"@tailwindcss/forms": "^0.2.1", "@tailwindcss/forms": "^0.2.1",
"autoprefixer": "^10.2.5", "autoprefixer": "^10.2.5",
"cssnano": "^4.1.10",
"postcss": "^8.2.8", "postcss": "^8.2.8",
"postcss-cli": "^8.3.1", "postcss-cli": "^8.3.1",
"tailwindcss": "^2.0.4" "tailwindcss": "^2.0.4"

View file

@ -1,9 +1,11 @@
const path = require('path'); const path = require('path');
const cssnano = require('cssnano')
module.exports = (ctx) => ({ module.exports = (ctx) => ({
plugins: [ plugins: [
require('tailwindcss')(path.resolve(__dirname, 'tailwind.config.js')), require('tailwindcss')(path.resolve(__dirname, 'tailwind.config.js')),
require('autoprefixer'), require('autoprefixer'),
process.env.NODE_ENV === 'production' ? cssnano({ preset: 'default' }) : null,
ctx.env === 'production' && require('@fullhuman/postcss-purgecss')({ ctx.env === 'production' && require('@fullhuman/postcss-purgecss')({
content: [ content: [
path.resolve(__dirname, 'templates/**/*.html') path.resolve(__dirname, 'templates/**/*.html')

View file

@ -3,7 +3,9 @@ const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = { module.exports = {
future: { future: {
}, },
purge: [], purge: [
"./templates/**/*.html"
],
theme: { theme: {
extend: { extend: {
colors: { colors: {