Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 8dd36bd

Browse files
committed
using rollup instead of microbundle
1 parent 5570d46 commit 8dd36bd

6 files changed

Lines changed: 422 additions & 2627 deletions

File tree

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-exact=true

mangle.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"name": "rex-state",
3-
"version": "0.0.4-beta-4",
3+
"version": "0.0.5",
44
"description": "The Simplest state management tool for React",
55
"scripts": {
6-
"build": "microbundle",
7-
"start": "microbundle watch",
6+
"build": "rollup -c rollup.config.js",
87
"test": "jest",
98
"coverage": "jest --coverage"
109
},
@@ -27,26 +26,28 @@
2726
"react-state"
2827
],
2928
"devDependencies": {
30-
"@babel/core": "^7.8.6",
31-
"@babel/preset-env": "^7.8.6",
32-
"@babel/preset-react": "^7.8.3",
33-
"@babel/preset-typescript": "^7.8.3",
34-
"@testing-library/react": "^9.4.1",
29+
"@babel/core": "7.8.6",
30+
"@babel/preset-env": "7.8.6",
31+
"@babel/preset-react": "7.8.3",
32+
"@babel/preset-typescript": "7.8.3",
33+
"@testing-library/react": "9.4.1",
3534
"@types/jest": "25.1.1",
3635
"@types/react": "16.9.19",
3736
"@typescript-eslint/parser": "2.20.0",
38-
"babel-jest": "^25.1.0",
37+
"@wessberg/rollup-plugin-ts": "1.2.21",
38+
"babel-jest": "25.1.0",
3939
"eslint": "6.8.0",
4040
"eslint-plugin-jest": "23.7.0",
4141
"eslint-plugin-prettier": "3.1.2",
4242
"eslint-plugin-tsc": "1.2.0",
4343
"husky": "4.2.1",
4444
"jest": "25.1.0",
45-
"microbundle": "^0.11.0",
4645
"prettier": "1.19.1",
4746
"pretty-quick": "2.0.1",
48-
"react": "^16.13.0",
49-
"react-dom": "^16.13.0",
47+
"react": "16.13.0",
48+
"react-dom": "16.13.0",
49+
"rollup": "2.0.2",
50+
"rollup-plugin-terser": "5.2.0",
5051
"typescript": "3.7.5"
5152
},
5253
"peerDependencies": {

rollup.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { terser } from "rollup-plugin-terser";
2+
import pkg from "./package.json";
3+
import ts from "@wessberg/rollup-plugin-ts";
4+
5+
export default {
6+
input: "src/index.tsx",
7+
output: [
8+
{
9+
file: pkg.main,
10+
format: "cjs"
11+
},
12+
{
13+
file: pkg.module,
14+
format: "es"
15+
},
16+
{
17+
file: pkg["umd:main"],
18+
format: "umd",
19+
name: "rexstate"
20+
}
21+
],
22+
external: [...Object.keys(pkg.dependencies || {})],
23+
plugins: [ts({}), terser()]
24+
};

src/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ import React, {
66
Dispatch
77
} from "react";
88

9-
// @ts-ignore - workaround for the issue with microbundle - https://github.com/developit/microbundle/issues/306
10-
Object.defineProperty(exports, "__esModule", {
11-
value: true
12-
});
13-
149
const useRex = <T extends object>(
1510
defaultState: T
1611
): [T, Dispatch<Partial<Pick<T, keyof T>>>] => {

0 commit comments

Comments
 (0)