Files
headlessui/packages/@headlessui-tailwindcss/package.json
T
Janeene Beeforth 3905be67a9 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>
2024-05-29 16:17:06 +02:00

50 lines
1.2 KiB
JSON

{
"name": "@headlessui/tailwindcss",
"version": "0.2.0",
"description": "A complementary Tailwind CSS plugin",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"module": "dist/headlessui.esm.js",
"type": "module",
"license": "MIT",
"files": [
"README.md",
"dist"
],
"exports": {
"types": {
"import": "./dist/index.d.ts",
"require": "./dist/index.d.cts"
},
"import": "./dist/headlessui.esm.js",
"require": "./dist/index.cjs"
},
"sideEffects": false,
"engines": {
"node": ">=10"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tailwindlabs/headlessui.git",
"directory": "packages/@headlessui-tailwindcss"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"prepublishOnly": "npm run build",
"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",
"lint-types": "npm run attw -P --workspaces --if-present",
"clean": "rimraf ./dist"
},
"peerDependencies": {
"tailwindcss": "^3.0"
},
"devDependencies": {
"tailwindcss": "^3.2.7"
}
}