Skip to content

Commit 8c3cb0e

Browse files
committed
refactor!: drop CommonJS distribution from package
BREAKING CHANGE: removes the CommonJS distribution from the package Signed-off-by: Jon Koops <[email protected]>
1 parent ad592cd commit 8c3cb0e

13 files changed

+185
-1557
lines changed

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,6 @@ console.log(files);
118118
> [!NOTE]
119119
> The above is experimental and subject to change.
120120
121-
### CommonJS
122-
123-
Convert a `DragEvent` to File objects:
124-
125-
```js
126-
const {fromEvent} = require('file-selector');
127-
128-
document.addEventListener('drop', async (event) => {
129-
const files = await fromEvent(event);
130-
console.log(files);
131-
});
132-
```
133-
134121
## Browser Support
135122
Most browser support basic File selection with drag 'n' drop or file input:
136123
* [File API](https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility)

jest.config.js

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

jest.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { type JestConfigWithTsJest, createDefaultEsmPreset } from 'ts-jest'
2+
3+
const defaultPreset = createDefaultEsmPreset()
4+
5+
const jestConfig: JestConfigWithTsJest = {
6+
...defaultPreset,
7+
testEnvironment: 'jsdom',
8+
// Map `.js` imports to one without an extension to prevent resolution errors.
9+
moduleNameMapper: {
10+
'^(\\.{1,2}/.*)\\.js$': '$1',
11+
},
12+
}
13+
14+
export default jestConfig

0 commit comments

Comments
 (0)