diff --git a/Makefile b/Makefile index 1906230..6713c89 100644 --- a/Makefile +++ b/Makefile @@ -19,4 +19,4 @@ examples/iife/demo.js: lib/esm/index.js examples/demo.tsx yarn run build:examples clean: - rm -rf lib examples/iife/demo.js + git clean -fX lib examples diff --git a/lib/esm/package.json b/lib/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/lib/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/lib/package.json b/lib/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/lib/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/package.json b/package.json index 640f6d6..61e4999 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,12 @@ "main": "./lib/index.js", "module": "./lib/esm/index.js", "types": "./lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/esm/index.js", + "require": "./lib/index.js" + } + }, "scripts": { "build": "yarn run build:code && yarn run build:examples", "build:code": "tsup src/index.tsx -d lib --format esm,cjs --dts --legacy-output --target=es2017 --platform=browser",