项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

38 lines
654 B

  1. /*
  2. * This example targets Node 4 and up.
  3. */
  4. const cssnano = require('cssnano');
  5. /*
  6. * Add your CSS code here.
  7. */
  8. const css = `
  9. h1 {
  10. color: #ff0000;
  11. font-weight: bold;
  12. }
  13. `;
  14. /*
  15. * Add your configuration here; see http://cssnano.co/options/ and
  16. * http://cssnano.co/optimisations/ for more details.
  17. *
  18. * For example you can turn off z-index rebasing by setting `zindex: false`
  19. * in your config, or you can use `safe: true` which will turn off unsafe
  20. * optimisations.
  21. */
  22. const opts = {
  23. };
  24. /*
  25. * Compress the CSS asynchronously and log it to the console.
  26. */
  27. cssnano.process(css, opts).then(result => {
  28. console.log(result.css);
  29. });