Skip to content

Commit b3e7302

Browse files
authored
Merge pull request #1078 from tailwindlabs/improve-build
Improve build files
2 parents fbaa1ae + 47756e2 commit b3e7302

File tree

14 files changed

+36
-43
lines changed

14 files changed

+36
-43
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Improve controlled Tabs behaviour ([#1050](https://github.com/tailwindlabs/headlessui/pull/1050))
1414
- Improve typeahead search logic ([#1051](https://github.com/tailwindlabs/headlessui/pull/1051))
1515
- Improve overal codebase, use modern tech like `esbuild` and TypeScript 4! ([#1055](https://github.com/tailwindlabs/headlessui/pull/1055))
16+
- Improve build files ([#1078](https://github.com/tailwindlabs/headlessui/pull/1078))
1617

1718
### Added
1819

@@ -25,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2526
- Ensure correct order when conditionally rendering `MenuItem`, `ListboxOption` and `RadioGroupOption` ([#1045](https://github.com/tailwindlabs/headlessui/pull/1045))
2627
- Improve typeahead search logic ([#1051](https://github.com/tailwindlabs/headlessui/pull/1051))
2728
- Improve overal codebase, use modern tech like `esbuild` and TypeScript 4! ([#1055](https://github.com/tailwindlabs/headlessui/pull/1055))
29+
- Improve build files ([#1078](https://github.com/tailwindlabs/headlessui/pull/1078))
2830

2931
### Added
3032

jest.config.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
projects: ['<rootDir>/packages/*/jest.config.cjs'],
3+
}

jest.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
3+
if (process.env.NODE_ENV === 'production') {
4+
module.exports = require('./headlessui.prod.cjs')
5+
} else {
6+
module.exports = require('./headlessui.dev.cjs')
7+
}

packages/@headlessui-react/build/index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
const create = require('../../jest/create-jest-config.js')
2-
1+
let create = require('../../jest/create-jest-config.cjs')
32
module.exports = create(__dirname, { displayName: 'React' })

packages/@headlessui-react/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@headlessui/react",
33
"version": "1.4.3",
44
"description": "A set of completely unstyled, fully accessible UI components for React, designed to integrate beautifully with Tailwind CSS.",
5-
"main": "dist/index.js",
5+
"main": "dist/index.cjs",
66
"typings": "dist/index.d.ts",
77
"module": "dist/headlessui.esm.js",
88
"license": "MIT",
@@ -11,14 +11,11 @@
1111
"dist"
1212
],
1313
"exports": {
14-
".": {
15-
"import": {
16-
"default": "./dist/headlessui.esm.js"
17-
},
18-
"require": "./dist/index.js",
19-
"types": "./dist/index.d.ts"
20-
}
14+
"import": "./dist/headlessui.esm.js",
15+
"require": "./dist/index.cjs",
16+
"types": "./dist/index.d.ts"
2117
},
18+
"type": "module",
2219
"sideEffects": false,
2320
"engines": {
2421
"node": ">=10"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
3+
if (process.env.NODE_ENV === 'production') {
4+
module.exports = require('./headlessui.prod.cjs')
5+
} else {
6+
module.exports = require('./headlessui.dev.cjs')
7+
}

packages/@headlessui-vue/build/index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)