Git Product home page Git Product logo

esbuild-postcss's Introduction

esbuild-postcss's People

Contributors

karolis-sh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

esbuild-postcss's Issues

cssnano doesn't minify when called via esbuild-postcss

I'm encountering a very strange issue. Perhaps @ludofischer from the cssnano project might have an idea as well.

I'm calling esbuild like so:

esbuild.build({
  entryPoints: ['src/app.tsx', 'src/app.css'],
  bundle: true,
  plugins: [postcss()],
  outdir: 'dist',
})

And my postcss.config.cjs reads as follows:

module.exports = {
  map: false,
  plugins: {
    'postcss-import': {},
    "tailwindcss/nesting": {},
    tailwindcss: {},
    autoprefixer: {},
    cssnano: { preset: 'default', },
  },
}

When I run npx postcss src/app.css directly, it prints minified CSS.

But when I run the esbuild.build function above (rm -rf dist && node esbuild.config.js && cat dist/app.css), it doesn't minify.

I tried commenting out the cssnano: { preset: 'default', } line to see if it makes any difference, and it turns out that cssnano does do some things, like combine border-width and border-color into a single border property. It just doesn't minify.

If you want to try and reproduce it, my code for this is at https://github.com/joliss/calculator.

I'm very confused as to why this might be happening.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.