Skip to content

Commit bfe68cb

Browse files
fix release bundle by using parcel instead of rollup
1 parent 98d0a1a commit bfe68cb

File tree

7 files changed

+1721
-596
lines changed

7 files changed

+1721
-596
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,6 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
# Parcel bundler
107+
.parcel-cache

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# use-clean-effect
22

3-
An extended version of React useEffect that is built-in with a simple clean-up function, hence you may not need to add your own clean-up function when using this.
3+
An extended version of React useEffect that is built-in with a simple clean-up function, hence, you may not need to add your own clean-up function when using this.
44

55
It also passes an argument to the useEffect callback that indicates if the component has been unmounted or re-rendered. Therefore, making it easy to invoke async functions in your useEffect callback and avoid memory leaks and removing the need for you to add a clean-up function.
66

package-lock.json

Lines changed: 1706 additions & 565 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
22
"name": "use-clean-effect",
3-
"version": "0.1.0",
3+
"version": "0.1.5",
44
"description": "An extension of React useEffect without the need for clean-up functions",
5-
"main": "dist/index.js",
6-
"browser": "dist/use-clean-effect.min.js",
5+
"source": "src/index.ts",
6+
"main": "dist/main.js",
7+
"module": "dist/module.js",
8+
"types": "dist/types.d.ts",
79
"files": [
810
"dist"
911
],
1012
"scripts": {
11-
"build": "tsc",
13+
"build": "parcel build",
1214
"rollup": "rollup -c",
1315
"test-build": "npm run build && node test-build.js",
14-
"prepublishOnly": "npm run test-build && npm run rollup",
16+
"prepublishOnly": "npm run test-build",
1517
"test": "echo \"Error: no test specified\" && exit 1"
1618
},
1719
"repository": {
@@ -37,12 +39,11 @@
3739
"react": ">=16.8.0"
3840
},
3941
"devDependencies": {
42+
"@parcel/packager-ts": "^2.6.2",
43+
"@parcel/transformer-typescript-types": "^2.6.2",
4044
"@types/react": "^18.0.14",
45+
"parcel": "^2.6.2",
4146
"react": "^18.2.0",
42-
"rollup": "^2.75.7",
43-
"rollup-plugin-babel-minify": "^10.0.0",
44-
"rollup-plugin-commonjs": "^10.1.0",
45-
"rollup-plugin-node-resolve": "^5.2.0",
4647
"typescript": "^4.7.4"
4748
}
4849
}

rollup.config.js

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

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ export function useCleanEffect(effect: EffectCallback, deps: DependencyList) {
2828
}, deps)
2929
}
3030

31-
Object.assign(module.exports, useCleanEffect)

test-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const assert = require("assert");
2-
const { useCleanEffect } = require("./dist");
2+
const { useCleanEffect } = require("./dist/main");
33

44
assert.equal(typeof useCleanEffect, "function");
55

0 commit comments

Comments
 (0)