Support ESModules
This commit is contained in:
parent
7a649fa1b0
commit
5203871aa8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
lib/
|
lib/
|
||||||
|
es/
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hibas123/utils",
|
"name": "@hibas123/utils",
|
||||||
"version": "2.2.3",
|
"version": "2.2.4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@hibas123/utils",
|
"name": "@hibas123/utils",
|
||||||
"version": "2.2.6",
|
"version": "2.2.7",
|
||||||
"description": "Different Utilities, that are not worth own packages",
|
"description": "Different Utilities, that are not worth own packages",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
"module": "es/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublishOnly": "tsc",
|
"prepublishOnly": "npm run build",
|
||||||
"build": "tsc",
|
"build": "tsc && tsc -p tsconfig.esm.json",
|
||||||
"watch-ts": "tsc -w"
|
"watch-ts": "tsc -w"
|
||||||
},
|
},
|
||||||
"author": "Fabian Stamm <dev@fabianstamm.de>",
|
"author": "Fabian Stamm <dev@fabianstamm.de>",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import Observable, { ObserverCallback } from "./observable";
|
import Observable, { ObserverCallback } from "./observable.js";
|
||||||
|
|
||||||
export type CheckFunction<T> = (val: T) => boolean;
|
export type CheckFunction<T> = (val: T) => boolean;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import Lock, { Release } from "./lock";
|
import Lock, { Release } from "./lock.js";
|
||||||
import Observable, {
|
import Observable, {
|
||||||
ObserverCallback,
|
ObserverCallback,
|
||||||
ObserverCallbackCollect,
|
ObserverCallbackCollect,
|
||||||
ObservableInterface,
|
ObservableInterface,
|
||||||
} from "./observable";
|
} from "./observable.js";
|
||||||
import AwaitStore from "./awaiter";
|
import AwaitStore from "./awaiter.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Lock,
|
Lock,
|
||||||
|
8
tsconfig.esm.json
Normal file
8
tsconfig.esm.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "classic",
|
||||||
|
"outDir": "es"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user