geocodeearth / autocomplete-element

A custom element for use with the Geocode Earth Autocomplete API.
https://geocode.earth
MIT License
8 stars 1 forks source link

refactor: css: replace css module with custom esbuild plugin #6

Closed mxlje closed 3 years ago

mxlje commented 3 years ago

This PR refactors the way we bundle CSS again, but this really should be the last time 🤞

It replaces the esbuild-css-modules-plugin with a much smaller and simpler solution: the new plugin uses esbuild itself to bundle the CSS and then returns it as a string using the built-in text loader, which means it gets inlined during the main build.

Aside from less dependencies and less complexity, this also has the advantage that the CSS is now minified, which reduces the bundle size (granted not by a lot as we don’t have a lot of CSS but, still).