Skip to content

Commit

Permalink
add canary entry point
Browse files Browse the repository at this point in the history
EskiMojo14 committed Apr 18, 2024
1 parent 4c1bfc6 commit f2b4523
Showing 3 changed files with 31 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .size-limit.ts
Original file line number Diff line number Diff line change
@@ -9,9 +9,22 @@ export default [
path: "dist/index.cjs",
name: "required-react-context (CJS)",
},
{
path: "dist/canary.js",
name: "required-react-context/canary",
},
{
path: "dist/canary.cjs",
name: "required-react-context/canary (CJS)",
},
{
path: "dist/index.js",
import: "{ createRequiredContext }",
name: "import { createRequiredContext } from 'required-react-context'",
},
{
path: "dist/canary.cjs",
import: "{ use }",
name: "import { use } from 'required-react-context/canary'",
},
] satisfies SizeLimitConfig;
12 changes: 12 additions & 0 deletions canary/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "required-react-context-canary",
"version": "1.0.0",
"description": "A simple React Context wrapper that throws an error if it is used without being provided",
"type": "module",
"main": "../dist/canary.cjs",
"module": "../dist/canary.js",
"types": "../dist/canary.d.ts",
"files": [
"../dist"
]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,10 @@
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./canary": {
"import": "./dist/canary.js",
"require": "./dist/canary.cjs"
}
},
"files": [
@@ -49,7 +53,8 @@
},
"tsup": {
"entry": [
"src/index.tsx"
"src/index.tsx",
"src/canary.tsx"
],
"sourcemap": true,
"format": [

0 comments on commit f2b4523

Please sign in to comment.