Giter VIP home page Giter VIP logo

Comments (6)

Siilwyn avatar Siilwyn commented on April 28, 2024 1

Yeah probably it's for the config resolution, didn't think of that!

Thought about the postcss integration some more, would prefer no predefined integration but instead setting it in the snowpack config as a plugin like done in Snowpack. Having it kind of integrated but not fully out of the box feels off to me...

from microsite.

natemoo-re avatar natemoo-re commented on April 28, 2024 1

Automatic PostCSS configuration has been removed in [email protected]!

from microsite.

natemoo-re avatar natemoo-re commented on April 28, 2024

There's not a way to disable @snowpack/plugin-postcss right now... Microsite automatically loads it so most users won't need a custom snowpack.config.cjs file. IMO that covers the more common use case (zero config), but I could consider disabling any automatic features like this if a custom snowpack.config.cjs file is detected? My concern is that I really don't want using a custom Snowpack config to feel like you're ejecting from Microsite itself—needing to re-enable out of the box features might start to feel like that?

As a side note, I don't see much a functional difference between the two plugins. The build script is more explicit? Because @snowpack/plugin-postcss executes almost the exact same code as @snowpack/plugin-build-script runs.

from microsite.

Siilwyn avatar Siilwyn commented on April 28, 2024

Think you are right that it does cover the most common use case.

Regarding a custom snowpack config I did find this function so if I understand correctly the config does get merged, don't think this is documented behaviour?

Indeed there is no substantial functional difference, what I like about the build script is the flexibility, allowing usage of any CLI tool to process files.
Going a bit off-topic here: I do not like tool specific plugins when a flexible alternative achieves the same. Take for example Gulp, when it released almost every package that did processing got a gulp package which wraps the original package. Some give little to no value over using the package directly but with the downside of maintenance churn, upstream issue management and more code. Some packages have there place ofc. for complex behaviour integrating in specific ways with the 'main tool' (Gulp).

A good example is @snowpack/plugin-dotenv, I use dotenv-safe in one snowpack project directly, which is as easy as invoking it in the snowpack config file. Which I love about Snowpack, I can compose existing tools without needing an extra specific wrapper.

Sidenote: I expected @snowpack/plugin-postcss to use the PostCSS JS api directly so there would be no need to spawn an extra process, which makes it even weirder to see it does invoke the command line tool instead...

from microsite.

natemoo-re avatar natemoo-re commented on April 28, 2024

You're right! Microsite needs some of those overrides to work properly, but some things (like the PostCSS plugin) are just for convenience. That behavior needs to be documented—I'll be sure to call out the PostCSS behavior specifically. It's a bit of a holdover from when PostCSS was built-in to Microsite but was removed for size reasons.

  • Totally agree with you on all the points about tool-specific plugins! Ecosystem churn is no fun for anyone.
  • I also find the way @snowpack/plugin-postcss works to be pretty weird! I think it's likely because config resolution is built into postcss-cli but not the JS api?

from microsite.

natemoo-re avatar natemoo-re commented on April 28, 2024

Still nailing down how to implement this in the most convenient way possible, but after giving it some consideration, I agree. Microsite shouldn't be injecting PostCSS into custom configs.

from microsite.

Related Issues (20)

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.