Skip to content

Commit

Permalink
build: add cjs output
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver committed Dec 23, 2020
1 parent 86cf41e commit 8edb8f1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export class MoviesStore extends ImmerComponentStore<MoviesState> {

## `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`

Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand Down
5 changes: 3 additions & 2 deletions src/component-store/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 3 additions & 2 deletions src/store/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
8 changes: 8 additions & 0 deletions tsconfig-build-cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist/cjs",
"target": "ES2019"
},
"extends": "./tsconfig-build.json"
}
8 changes: 8 additions & 0 deletions tsconfig-build-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"module": "esnext",
"outDir": "dist/esm",
"target": "ES2019"
},
"extends": "./tsconfig-build.json"
}
3 changes: 0 additions & 3 deletions tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"compilerOptions": {
"declaration": true,
"sourceMap": true,
"module": "esnext",
"outDir": "dist",
"target": "ES2019"
},
"include": ["**/*.ts"],
"exclude": ["**/*.test.ts"],
Expand Down

0 comments on commit 8edb8f1

Please sign in to comment.