-
Notifications
You must be signed in to change notification settings - Fork 98
Conversation
Add cssnano as plugin to postcss.config.js
This reverts commit 7705c4f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea behind keeping the un-minified output was keeping an eye on potential regressions related to the PostCSS pipeline. But it should be fairly easy to overcome by commenting out the cssnano
line in the config. 👍
That's a valid concern, and one that I want to be responsive to. What ultimately matters is that the CSS looks good with the generated HTML, and that's a subjective measure that must be done manually. I can imagine how seeing a diff of the generated CSS would be desirable, but I see a few downsides to keeping
Here's one way to get the benefits of diffing the compiled output without the aforementioned costs:
+ *.min.css diff=mincss
[diff "mincss"]
textconv = js-beautify --css
cachetextconv = true This would expand the CSS into a normalized, human-readable form before performing a standard Not saying that we should add this immediately, but rather to share an alternative solution if later we start to feel the loss of |
Neat idea! Haven't thought about using git for this sort of thing, which is a natural place to look in hindsight. |
@kaishin It's a neat technique. I learned about it as a potential solution for that perennial issue of Xcode project file merge conflicts. |
After merging #49, I noticed a few things about the current setup:
-u cssnano
option in thebuild
command was overriding / wiping out everything in the configuration file. I noticed this after generating HTML locally (downloading CSS from the raw GitHub source on master). Seeing&
in the generated, minified CSS, I thought it had something to do with the Sass syntax and committed 7705c4f. However, as you mentioned, that functionality is already provided bypostcss-preset-env
.build
andwatch
seemed unnecessary. If we only usewatch
, we don't need an additional, separate step at the end of the process.Resources
.This PR resolves these by removing the
build
script, removing and ignoring unminified CSS from Resources, and incorporating cssnano as a plugin.