Skip to content

Commit ac1462d

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 ac1462d

13 files changed

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

0 commit comments

Comments
 (0)