projectwallace / format-css

Fast, small, zero-config library to format CSS using basic rules.
https://www.projectwallace.com/blog/tiny-css-formatter
MIT License
10 stars 0 forks source link

Webpack error with exports->default in package.json #49

Closed jeff-fillmore closed 4 months ago

jeff-fillmore commented 4 months ago

First off, thanks for your work on the project!

Got this error when using webpack 5.91.0 on version 1.3.2 of format-css: Module not found: Error: Default condition should be last one

Version 1.3.1 works when the last exports was default and when I manually update the package.json for format-css so the last exports is default then webpack works.

  "exports": {
    "require": "./dist/format.cjs",
    "types": "./dist/index.d.ts",
    "default": "./dist/format.modern.js"
  },

Webpack documentation

bartveneman commented 4 months ago

Thanks for reporting! Fix is in https://github.com/projectwallace/format-css/releases/tag/v1.3.3