diff --git a/.github/workflows/compressed-size.yml b/.github/workflows/compressed-size.yml index 958fd22..45cad2f 100644 --- a/.github/workflows/compressed-size.yml +++ b/.github/workflows/compressed-size.yml @@ -8,3 +8,5 @@ jobs: steps: - uses: actions/checkout@v2 - uses: preactjs/compressed-size-action@v2 + with: + pattern: "./dist/*.{js,mjs,cjs}" diff --git a/package.json b/package.json index 666ffe7..767bbca 100644 --- a/package.json +++ b/package.json @@ -2,20 +2,24 @@ "name": "mitt", "version": "2.1.0", "description": "Tiny 200b functional Event Emitter / pubsub.", - "jsnext:main": "dist/mitt.es.js", - "source": "src/index.ts", - "module": "dist/mitt.es.js", - "esmodules": "dist/mitt.modern.js", + "module": "dist/mitt.mjs", "main": "dist/mitt.js", + "jsnext:main": "dist/mitt.mjs", "umd:main": "dist/mitt.umd.js", + "source": "src/index.ts", "typings": "index.d.ts", + "exports": { + "import": "./dist/mitt.mjs", + "require": "./dist/mitt.js", + "default": "./dist/mitt.mjs" + }, "scripts": { "test": "npm-run-all --silent typecheck lint mocha test-types", "mocha": "mocha test", "test-types": "tsc test/test-types-compilation.ts --noEmit --strict", "lint": "eslint src test --ext ts --ext js", "typecheck": "tsc --noEmit", - "bundle": "microbundle", + "bundle": "microbundle -f es,cjs,umd", "build": "npm-run-all --silent clean -p bundle -s docs", "clean": "rimraf dist", "docs": "documentation readme src/index.ts --section API -q --parse-extension ts",