Comments (3)
Hey @ineptian, the issue is with html-minifier and it's dependency of clean-css to handle minifying CSS within <style>
tags during HTML compression. This is noted as the culprit here. Clean CSS does actually support this in newer versions but the version html-minifier includes is a few years old and doesn't look likely to be updated any time soon.
There's a few options. Firstly, we want to stop html-minifier touching our CSS.
- On line 11 in
./utils/transforms.js
set theminifyCSS
option tofalse
or remove it completely.
If you run a build, everything should now work as expected but the inline CSS won't be minified.
Switch to cssnano for minifying
- Install cssnano as a dependency
npm install cssnano --save-dev
- Update
./postcss.config.js
to inline CSS in production
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
isProduction && require('cssnano')({
preset: 'default',
}),
]
}
Hope this helps.
from eleventy-web-starter.
@chrissy-dev thanks so much for being so on it with the replies. I installed css nano and that worked great but I actually haven't tested the filters yet since I already migrated away from using them in the meantime. I have been wanting to test this though and will report back when I have time. You can keep closed for now.
from eleventy-web-starter.
@ineptian Closing this but feel free to comment on it to pick it up again 😊
from eleventy-web-starter.
Related Issues (20)
- app.js seems not working on production build HOT 3
- [Enhancement] Add eleventy-img to template HOT 2
- Build script on Windows HOT 3
- Missing site data path in Eleventy config HOT 2
- Version 2 Roadmap HOT 1
- How to get ELEVENTY_ENV variable set to production HOT 3
- node_env etc on windows (and others) HOT 3
- I don't think you need Luxon HOT 1
- Browsersync not working HOT 2
- 404 Page is included in the sitemap
- Remove ./utils folder to simplify config
- Netlify Builds Failing HOT 1
- Add a simple blog collection with tags
- Add note in README about using `cross-env ` on Windows
- Audit the head of the document
- Basic schema markup for posts
- Add RSS feed for posts
- Question: Should this project contain a sample blog? HOT 2
- Updating to tailwind 1.4 (purge built in) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eleventy-web-starter.