diff --git a/README.md b/README.md index 54f48e5..4b57e3d 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,8 @@ export class MoviesStore extends ImmerComponentStore { ## `immerReducer` -`immerReducer` is a reducer method by using the Immer `produce` method. -This method is used by the methods in this library, this idea was inspired by [Alex Okrushko](https://twitter.com/alexokrushko). +Inspired by [Alex Okrushko](https://twitter.com/alexokrushko), `immerReducer` is a reducer method that uses the Immer `produce` method. +This method is used by all of the methods in `ngrx-immer` provides. ## Migrating from `ngrx-etc` to `ngrx-immer` diff --git a/package.json b/package.json index 348aadf..3c28c85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngrx-immer", - "version": "0.0.1", + "version": "0.0.2", "description": "Immer wrappers around NgRx methods createReducer, on, and ComponentStore", "keywords": [ "NgRx", @@ -20,15 +20,18 @@ "homepage": "https://github.com/timdeschryver/ngrx-immer#readme", "private": false, "sideEffects": false, - "module": "shared.js", - "types": "shared.d.ts", + "main": "cjs/shared.js", + "module": "esm/shared.js", + "types": "esm/shared.d.ts", "publishConfig": { "access": "public" }, "scripts": { "test": "jest", "prebuild": "rimraf dist && rimraf *.tgz", - "build": "tsc -p tsconfig-build.json", + "build": "npm run build:cjs && npm run build:esm", + "build:cjs": "tsc -p tsconfig-build-cjs.json", + "build:esm": "tsc -p tsconfig-build-esm.json", "postbuild": "cpy **/package.json ../dist --cwd=./src --parents && cpy package.json dist && cpy README.md dist" }, "peerDependencies": { diff --git a/src/component-store/package.json b/src/component-store/package.json index e41448f..e8cbbb0 100644 --- a/src/component-store/package.json +++ b/src/component-store/package.json @@ -1,4 +1,5 @@ { - "module": "index.js", - "types": "index.d.ts" + "main": "../cjs/component-store/index.js", + "module": "../esm/component-store/index.js", + "types": "../esm/component-store/index.d.ts" } diff --git a/src/store/package.json b/src/store/package.json index e41448f..cf3685a 100644 --- a/src/store/package.json +++ b/src/store/package.json @@ -1,4 +1,5 @@ { - "module": "index.js", - "types": "index.d.ts" + "main": "../cjs/store/index.js", + "module": "../esm/store/index.js", + "types": "../esm/store/index.d.ts" } diff --git a/tsconfig-build-cjs.json b/tsconfig-build-cjs.json new file mode 100644 index 0000000..ea2d53f --- /dev/null +++ b/tsconfig-build-cjs.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "module": "commonjs", + "outDir": "dist/cjs", + "target": "ES2019" + }, + "extends": "./tsconfig-build.json" +} diff --git a/tsconfig-build-esm.json b/tsconfig-build-esm.json new file mode 100644 index 0000000..cb26f02 --- /dev/null +++ b/tsconfig-build-esm.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm", + "target": "ES2019" + }, + "extends": "./tsconfig-build.json" +} diff --git a/tsconfig-build.json b/tsconfig-build.json index 8ef203c..69d97e1 100644 --- a/tsconfig-build.json +++ b/tsconfig-build.json @@ -2,9 +2,6 @@ "compilerOptions": { "declaration": true, "sourceMap": true, - "module": "esnext", - "outDir": "dist", - "target": "ES2019" }, "include": ["**/*.ts"], "exclude": ["**/*.test.ts"],