Fix esm compatibility for @headlessui/tailwindcss plugin package (#3051)
* Set @headlessui/tailwindcss module type The distributed tailwindcss plugin package uses `.js` for esm files, and `.cjs` for commonjs files. This corresponds to `"type": "module"` in the package.json file. One build script `fix-types.js` was a commonjs script which was breaking this module file naming pattern. Renamed the script to `fix-types.cjs` so that we could then standardise the module type for @headlessui/tailwindcss package as a whole. * Fix esm import of tailwindcss/plugin ESM imports need to specify the filename extension when importing individual files. * update changelog --------- Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
This commit is contained in:
@@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix ESM types ([#2880](https://github.com/tailwindlabs/headlessui/pull/2880))
|
||||
- Improve CJS types ([#2880](https://github.com/tailwindlabs/headlessui/pull/2880))
|
||||
- Improve ESM types ([#3051](https://github.com/tailwindlabs/headlessui/pull/3051))
|
||||
|
||||
## [0.2.0] - 2023-07-27
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"main": "dist/index.cjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"module": "dist/headlessui.esm.js",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"README.md",
|
||||
@@ -32,7 +33,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run build",
|
||||
"build": "../../scripts/build.sh --external:tailwindcss && node ./scripts/fix-types.js",
|
||||
"build": "../../scripts/build.sh --external:tailwindcss && node ./scripts/fix-types.cjs",
|
||||
"watch": "../../scripts/watch.sh --external:tailwindcss",
|
||||
"test": "../../scripts/test.sh",
|
||||
"lint": "../../scripts/lint.sh",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import plugin from 'tailwindcss/plugin'
|
||||
import plugin from 'tailwindcss/plugin.js'
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user