If you have been using PostCSS, there is a good chance you have been using cssnano to create your final minified style-sheet. Cssnano has been a great library and the community go to for a long time.
Version 6 of PostCSS changed the api a bit which causes some method to be deprecated including Node#moveTo. If you updated to PostCSS or even started a fresh setup including PostCSS and cssnano, you are likely getting this message in the console.
Node#moveTo was deprecated. Use Container#append.
Now while this message does not appears to be harmful, it is quite annoying and breaks the sense of confidence on you minified file to say the least. Not to mention it’s letting you know that your cssnano will break entirely in the future.
I spent many months monitoring the status of cssnano in hopes that it would work with PostCSS 6 with ultimately these findings:
- The original maintainer has gotten overwhelmed with a day job and no longer is supporting the project.
- The successor ended up not really doing very much and is now MIA.
- There are mentions of version 4 which is suppose to work but was never completed.
- The project seems be being passes around between a few surrogate developers.
The gist is this feels too much like waiting for disaster for me to continue using this module. So I set out to find a new one…..
Welcome to postcss-clean ! This is a drop in replacement for cssnano. This uses clean-css which has a ton options of but after testing most of them, you really can leave the majority of defaults. The only one I ended up changing was level which I set to 2 (default is 1).
To get started (but you probably already understand how all this works 🙂 )
If you are using Grunt, remove the
cssnano declaration in favor of
If you are using Webpack remove the
cssnano section of
postcss.config.js and replace it with